第四章 监督学习

4.1 Generalized Linear Models  广义线性模型

yˆ(w,x)=w0 +w1x1 +...+wpxp w是权重
线性回归就是找到 = (w, ..., w)  使平方差最小

>>> from sklearn import linear_model
>>> clf = linear_model.LinearRegression()
>>> clf.fit ([[0, 0], [1, 1], [2, 2]], [0, 1, 2])

LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=False)

>>> clf.coef_
array([ 0.5, 0.5]) 

4.1.2 岭回归

Ridge Regression  待研究

4.1.3 Lasso 

4.1.4 Elastic Net 

ElasticNet is a linear regression model trained with L1 and L2 prior as regularizer. 

4.1.5 Multi-task Lasso 

The MultiTaskLasso is a linear model that estimates sparse coefficients for multiple regression problems jointly: 

4.1.6 Least Angle Regression 

4.1.7 LARS Lasso 

4.1.8 Orthogonal Matching Pursuit (OMP) 

4.1.9 Bayesian Regression 

4.1.10 Logistic regression 

4.1.11 Stochastic Gradient Descent - SGD 

随机梯度下降

4.1.12 Perceptron 

感知机

4.1.13 Passive Aggressive Algorithms 

4.1.15 Polynomial regression: extending linear models with basis functions 

4.2 Linear and quadratic discriminant analysis 线性与二次方程分析

Linear discriminant analysis (lda.LDA) and quadratic discriminant analysis (qda.QDA) are two classic classifiers, 

4.2.1 Dimensionality reduction using LDA 

使用LDA降维在

lda.LDA.transform 中

4.4.1 Classification 

>>> from sklearn import svm>>> X = [[0, 0], [1, 1]]>>> y = [0, 1]
>>> clf = svm.SVC()

>>> clf.fit(X, y)

>>> clf.predict([[2., 2.]]) 

>>> # get support vectors

>>> clf.support_vectors_ 

>>> # get indices of support vectors
>>> clf.support_

>>> # get number of support vectors for each class

>>> clf.n_support_ 









评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值