Google Compute Engine enable ssh using password

Find Nearest K points

Efficiently find nearest points KD tree

The basic idea is illustrated here

k-d Tree and Nearest Neighbor Search

though I don’t think the pruned areas are plotted correctly.

This algorithms are used for KNN

Similar tree structure quad-tree/octree are explained here

https://www.quora.com/What-is-the-difference-between-kd-tree-and-octree-Which-one-is-advantageous

 

SVM vs LR

SVM, LR typically give out similar results.

  1. LR is probabilistic, while SVM is non-probabilistic binary classifier (there are ways of get around of this)
  2. SVM is determined by support vectors (points lie between soft margin, this region size is determined by C/lambda), while RL is affected by all points. This is only true when no kernel is applied. Some ppl says SVM is less sensitive to outlier, while I also see opposite statement.
  3. Due to same above reason, linear SVM (no kernel) needs normalization,while LR does not. It is also likely SVM may have worse performance than LR due to the complex space distance measurement in high dimensional space.
  4. when applied with kernel tricks, it is found that SVM hold higher sparsity. Thus, SVM is better in computational complexity. (this is commonly brought up, but did not see why it is though).

 

Google Cloud Machine Learning

1. Create an Google Compute Engine Instance
2. Activate the Google Machine Learning API under this project
3. Create an Google Storage Bucket
4. Login to the Google Compute Engine, create a folder for the ML project, in my case I called it MLtest. Inside this folder, two basic configuration files are required.

a. config.yaml

It is important to set “runtimeVersion” to be the latest, otherwise, some functions may not be available.

b. setup.py

5. The file inside the folder shows the structure blow.

to run a training module LOCALLY, such as 8-output.py, you type

In order to submit the job to Google Cloud ML, the following command is required,

However, users will not be able to read and write directory to the cloud storage bucket. As this being said, below commands will NOT work.

File IO can to be handle through

Similarly, you can read a file through the same way.

6. To check the current status of jobs,

 

Anaconda virtual environment setup python 2, 3 and R

After install anaconda 3

 

Tree Based Models

Regression tree

Xgboost manages only numeric vectors. So is decision trees in Sklearn

What to do when you have categorical data?

Conversion from categorical to numeric variables

Adaboost (Adaptive boost) http://machinelearningmastery.com/boosting-and-adaboost-for-machine-learning/

parameters for Xgboost

Complete Guide to Parameter Tuning in XGBoost (with codes in Python)

reg:linear simply square loss function
reg:logistic see logistic regression loss function
https://stats.stackexchange.com/questions/229645/why-there-are-two-different-logistic-loss-formulation-notations/231994#231994

objective function vs eval_metric

https://stackoverflow.com/questions/34178287/difference-between-objective-and-feval-in-xgboost