I wrote about the solutions to some problems I found from programming and data analytics. They may help you on your work. Thank you.
ezoic
Monday, December 7, 2020
Wednesday, November 11, 2020
Tuesday, November 3, 2020
Sunday, November 1, 2020
Saturday, October 31, 2020
Friday, October 30, 2020
Wednesday, October 28, 2020
Tuesday, October 27, 2020
Sunday, October 25, 2020
Saturday, October 24, 2020
Friday, October 23, 2020
Saturday, October 17, 2020
Monday, October 12, 2020
Wednesday, October 7, 2020
Sunday, October 4, 2020
clustering
k-means clustering
https://towardsdatascience.com/understanding-k-means-clustering-in-machine-learning-6a6e67336aa1
hierarchical clustering
Thursday, October 1, 2020
Wednesday, September 23, 2020
Thursday, September 17, 2020
Wednesday, September 16, 2020
Monday, September 7, 2020
Thursday, August 27, 2020
Build a website using hugo
Build a website using hugo
https://www.youtube.com/watch?v=c7vpcqA6SEQ
https://gohugo.io/getting-started/installing/
How to create a new hugo blog post.
https://www.youtube.com/watch?v=cunYNe7qLjE
some other methods:
bo-blog
wordpress
jekyll
some other related articles
https://jdhao.github.io/2019/09/22/google_adsense_hugo_config/
https://www.qikqiak.com/post/add-adsense-in-hugo-article/
Monday, August 24, 2020
Monday, June 8, 2020
Wednesday, April 22, 2020
How to fix the USB when it lost space
First move the things in your USB to another place. The steps here will make things in USB lost.
In a windows environment, follow the steps
1. In the start menu, search for and launch diskpart.
2. Type list disk to see all current disk volumes on your system,
3. Plug in the USB and type list disk. Note the newly listed volume, that's your USB's.
4. Type select disk#, where # is your USB's volume number.
5. Type Clean to wipe the volume of alll partitions.
6. Type create partition primary to make a new partition with all unallocated space.
7. type exit to finish.
When I tried to fix my USB, I tried steps 4,5 twice. It did not work at the first time.
When I tried to use my USB, it showed that I need to format the USB. And I formatted the USB. It got back to normal.
Saturday, April 11, 2020
Using ubuntu, and sometimes it freezes and crashes, how I fixed it
sometimes it freezes and crashes.
And I found that most of the time, the browsers freeze. I used firefox and chrome.
And I look for some other browsers. And I found opera and chromium.
I tried to install opera.
I downloaded opera deb file. And tried to install deb.
I tried the command first:
sudo apt install ...deb
not working
Then I tried sudo dpkg -i xxx.deb
works.
finally installed opera. now it seems no crashes or freezes
Opera seems stable. But it does not support some videos.
To install chromium, I used
sudo apt install -y chromium-browser
And I installed it. chromium seems not so stable as opera.
Tuesday, March 24, 2020
how to fix R's error Error: variables "xxx" were specified with different types from the fit
Error: variables ‘xxx" were specified with different types from the fit
How to fix it?
Mainly the reason for it is that in the data where we did the predicting the data type for some variables are different from the data type for some variables from the modeling.
You can check the data types in the data where we will do the predicting.
Once I found that , there were some quotes in the data which made the data into character. Then I unquoted the data and made the data types into numerical. problem solved.
Sample script:
newData=noquote(newData)
newData$in_dream1<-as.numeric(newData$in_dream1)
newData$selected_by1<-as.numeric(newData$selected_by1)
newData$form1<-as.numeric(newData$form1)
newData$points_game1<-as.numeric(newData$points_game1)
newData$element_type1<-as.factor(newData$element_type1)
inc.com is an interesting webpage
there is a 5000 companies list every year:
https://www.inc.com/inc5000/2019/top-private-companies-2019-inc5000.html
Sunday, March 22, 2020
10 linux simple free games
1. Card game, kpatience
2. Brutal Chess
3. SuperTuxKart
4. SDL-Ball
5. KBlocks
6. Secret Maryo Chronicles
7. Gweled
8 Zaz
9. Frozen Bubble
10. Torcs
Saturday, March 21, 2020
Tuesday, March 10, 2020
Not able to install kernlab package in R, how to resolve the problem
Tried to install it by install.packages("kernlab", type="source"), but failed.
And download from
https://cran.r-project.org/web/packages/kernlab/index.html
And install on a terminal
R CMD INSTALL kernlab_0.9-19.tar
And library(kernlab)
Monday, March 9, 2020
model selection caret in R
Caret is the short for Classification And REgression Training.
How to do the predictive modeling in caret/R, steps
https://towardsdatascience.com/create-predictive-models-in-r-with-caret-12baf9941236
How to do the classification modeling in caret/R, steps:
https://rpubs.com/ezgi/classification
Working with json file using R
https://blog.exploratory.io/working-with-json-data-in-very-simple-way-ad7ebcc0bb89
read in a json file from webpage using the package in R rjson:
newElements<-fromJSON(file("https://fantasy.premierleague.com/api/bootstrap-static/"))
the data we needed is an element in json file , how to read it and make it a data frame
newElements <- as.data.frame(newElements$elements)
R rds and rda models
commands:
save rda model
save(model_nnet, file = "/tmp/model_nnet.rda")
load rda model
load(file = "/tmp/model_nnet.rda")
save rds
saveRDS(model_nnet, file = "/tmp/model_nnet2.rda")
load rds
model2 <- readRDS("/tmp/model_nnet2.rda")
Sunday, March 8, 2020
Top 10 programming languages used in web development
Top 10 programming languages used in web development
JavaScript
C++
PHP
Ruby
statistics' application on medical area
1. Clinical trial sample size and power analysis
2. cox proportional hazards model
Saturday, March 7, 2020
Things about classification AUC, ROC, recall, precision, sensitivity, specificity and F1
There are a lot of classification methods. logistic, support vector machine, random forest
In R, there is a package called caret , classification and regression training . There are a lot of built-in classification methods :
https://rdrr.io/cran/caret/man/models.html
To measure the effectiveness of a classification method, there are some metrics :
AUC, ROC, recall, precision, sensitivity, specificity and F1
1. ROC and AUC
A receiver operating characteristic curve or ROC curve, is a graphical plot that illustrates the diagnostic ability of binary classifier system as its discrimination threshold is varied.
The ROC curve is created by plotting the true positive rate against the false positive rate at various threshold settings. True positive rate is also known as sensitivity, recall or probability of detection. The false positive rate is also known as probability of false alarm, and can be calculated as (1-specificity). It can also be thought of as a plot of the power as a function of the Type I Error of the decision rule.
AUC means area under the ROC curve. It is a value between 0 and 1. The closer AUC is to 1, the more accurate the classification prediction is.
2. Recall, precision , sensitivity , specificity , F1
The values are from confusion matrix
precision=true positive/(true positive + false positive)
recall ( sensitivity) =true positive /(true positive + false negative)
specificity =true negative /(true negative + false positive)
F1 Score = 2*(Recall * Precision) / (Recall + Precision)
High recall and high precision show that the classifier is returning accurate results ( high precision ) , as well as returning a majority of all positive results ( high recall).
specificity is the true negative rate. high specificity means that the classifier is retuning a majority of all negative results.
Wednesday, February 19, 2020
recommendation systems
item based
https://en.wikipedia.org/wiki/Item-item_collaborative_filtering
item based and user based recommendation systems
https://medium.com/@cfpinela/recommender-systems-user-based-and-item-based-collaborative-filtering-5d5f375a127f
Tuesday, January 28, 2020
predictive modeling in python
Monday, January 20, 2020
Monday, January 13, 2020
10 useful python data visilization tools
I used matplotlib and ggplot
ggplot2 is for R
looking for a man
I am a mid aged woman. I was born in 1980. I do not have any kid. no complicated dating before . I am looking for a man here for marriage...
-
I tried to commit script to bitbucket using sourcetree. I first cloned from bitbucket using SSH, and I got an error, "authentication ...
-
https://github.com/boto/boto3/issues/134 import boto3 import botocore client = boto3.client('s3') result = client.list_obje...
-
Previously, I wanted to install "script" on Atom to run PHP. And there was some problem, like the firewall. So I tried atom-runner...