随笔分类 - 机器学习笔记
PRML学习过程中的一些公式推导及程序实现
摘要:template <class T1, class T2> double Minkowski(const std::vector<T1> &inst1, const std::vector<T2> &inst2, const double &k) { if(inst1.size() != inst2
阅读全文
摘要:原始数据 #include <iostream>#include <fstream>#include <sstream>#include <vector>#include <string>#include <algorithm>#include <numeric>#include <cmath>#i
阅读全文
摘要:原始数据 Say you are given a data set where each observed example has a set of features, but has nolabels. Labels are an essential ingredient to a supervi
阅读全文
摘要:Pseudo Code of KNN We can implement a KNN model by following the below steps: Load the data Initialise the value of k For getting the predicted class,
阅读全文
摘要:Nearest-neighbor methods use those observations in the training set T closest in input space to x form Y-hat. Specifically, the k-nearest neighbor fit
阅读全文
摘要:import tensorflow as tfw1 = tf.Variable(tf.random_normal((2, 3), stddev=1, seed=1))w2 = tf.Variable(tf.random_normal((3, 1), stddev=1, seed=1))x = tf.
阅读全文
摘要:在电脑上安装PyCharm和Python3,然后把Python3的安装路径写进系统变量里,Python安装完之后, https://bootstrap.pypa.io/get-pip.py,把这页的代码复制出来,拿到python里运行,就可以成功安装 pip3了,然后把pip3的路径写进环境变量,打
阅读全文
摘要:Multiplying both sides of this result by wT and adding w0, and making use of y(x)=wTx+w0 and y(xΓ)=wTxΓ+w0=0, we have r=y(x)/||w||. The idea proposed
阅读全文
摘要:The issue at hand is to find the parameters wo and bo for the optimal hyperplane, given the training set {(xi,di)}.
阅读全文
摘要:Basically, the support vector machine is a binary learning machine with some highly elegant properties. Given a training sample, the support vector ma
阅读全文
摘要:When neuron j is located in a hidden layer of the network, there is no specified desired response for that neuron. For this derivative to exist, we re
阅读全文
摘要:When neuron j is located in the output layer of the network, it is supplied with a desired response of its own. If neuron j is in the first hidden lay
阅读全文
摘要:An elegant and powerful method for finding maximum likelihood solutions for models with latent variables is called the expectation-maximization algori
阅读全文
摘要:The K-means algorithm is based on the use of squared Euclidean distance as the measure of dissimilarity between a data point and a prototype vector. O
阅读全文
摘要:To summarize, principal component analysis involves evaluating the mean x and the covariance matrix S of the data set and then finding the M eigenvect
阅读全文
摘要:Thus we see that there are very close similarities between this Bayesian viewpoint and the conventional one based on error function minimization and r
阅读全文
摘要:记得去上第一节课的时候,老师就问,你们知道什么是自适应吗?还举了个例子说,北方人来到了南方, 会觉得天气特别热,饮食也不太一样,这时他就开始去慢慢适应南方的环境,自适应就开始了。 The adaptive linear combiner, which is the simplest and most
阅读全文
摘要:template <class T1, class T2>double Pearson(std::vector<T1> &inst1, std::vector<T2> &inst2) { if(inst1.size() != inst2.size()) { std::cout<<"the size
阅读全文