This is a creation in Article, where the information may have evolved or changed.
This series of tutorials is suitable for machine learning, even the arts sen Oh. There will be no mathematical formula, I promise! Tutorials are based on the Sklearn Python machine learning Library.
Open the veil of machine learning, that's it.
The first thing is to have a sharp weapon. 工欲善其事 its prerequisite. Look at my next article, download the software, and then we can start.
http://blog.csdn.net/qtlyx/article/details/49742483
1. What is machine learning?
Data mining, deep learning, pattern recognition, big data mining. It all sounds like a deep-down look. In fact, it is a sentence: Classification and prediction! That's good to say is doing these two things.
2. Linear regression
Start right now! There is one thing called least squares, and it doesn't matter if you don't know.
There is such a picture, there are so many points are known, and now the problem, tell you the value of the horizontal axis is 0.56 points, the value of the vertical shaft should be how much? That's the prediction. The simplest method is the least squares, which is to find a straight line that can predict the value of the 0.56 point corresponding to the function. So how do you draw this line? The next step is Sklearn's debut. http://scikit-learn.org/stable/
This is the official website of Sklearn, all very detailed explanation, but certainly not as I popular ~anaconda inside integrates this package, the direct import can.
Import Matplotlib.pyplot as plt# Paint package import NumPy as Np#sklearn support package from Sklearn import datasets, linear_model# importing datasets and Linear models in Sklearn # read a set of data, as if it were diabetes. This is not the point diabetes = datasets.load_diabetes () diabetes_x = diabetes.data[:, Np.newaxis, 2]diabetes_x = diabetes_X[:-20] Diabetes_y = diabetes.target[:-20]# emphasis comes, here the use of data to establish a linear regression class Regr = Linear_model. Linearregression () #把数据放进去, say good point, let this model "learn" a bit. The data is our point. Regr.fit (diabetes_x, diabetes_y)
regr.coef_# the line that returns the least squares. are constant and one-time coefficients, respectively.
That's the way the line is drawn. Then you can happily take the line and predict it. Machine learning, in fact, is so simple.