LeetCode Notes 002

Add Binary

Given two binary strings, return their sum (also a binary string).

For example,
a = “11”
b = “1”
Return “100”.

阅读更多
A simple Metropolis-Hastings MCMC in R

While there are certainly good software packages out there to do the job for you, notably BUGS or JAGS, it is instructive to program a simple MCMC yourself. In this post, I give an educational example of the Bayesian equivalent of a linear regression, sampled by an MCMC with Metropolis-Hastings steps, based on an earlier version which I did to together with Tamara Münkemüller. Since first publishing this post, I have made a few small modifications to improve clarity. A similar post on Metropolis-Hastings MCMC algorithms by Darren Wilkinson is also worth looking at. More on analyzing the results of this algorithm can be found in a recent post.

阅读更多
Decision_Tree_Regression

Decision Tree Regression (using DecisionTrees.jl)

Adapted from http://scikit-learn.org/stable/auto_examples/tree/plot_tree_regression.html

阅读更多
Classifier_Comparison阅读更多
Cross_Validated_Predictions

Plotting Cross-Validated Predictions

Adapted from http://scikit-learn.org/stable/auto_examples/plot_cv_predict.html

阅读更多
Clustering_Comparison

Comparing different clustering algorithms on toy datasets

Adapted from http://scikit-learn.org/stable/auto_examples/cluster/plot_cluster_comparison.html

阅读更多