这次整理一下常用的scikit-learn包,作为备忘
K近邻算法:
from sklearn.neighbors import KNeighborsClassifier
线性回归:
from sklearn.linear_model import LinearRegression
逻辑回归:
from sklearn.linear_model import LogisticRgression
决策树:
from sklearn.tree import DecisionTreeClassifier
朴素贝叶斯:
- 高斯分布:from sklearn.neive_bayes import GaussianNB
- 多项式分布:from sklearn.neive_baybes import MultinomnalNB
- 伯努利分布:from sklearn.neive_baybes import BernoulliNB
支持向量机:
集合算法(sklearn.ensemble):
- bagging:
分类:from sklearn.ensemble import BaggingClassifier
回归:from sklearn.ensemble import BaggingRegression
- AdaBoost:
分类:from sklearn.ensemble import AdaBoostClassifier
回归:from sklearn.ensemble import AdaBoostRegression
- 随机森林:
分类:from sklearn.ensemble import RandomForestClassifier
回归:from sklearn.ensemble import RandomForestRegression
K均值:
from sklearn.cluster import KMeans
PCA降维:
from sklearn.decomposition import PCA
最后附上一张scikit寻宝图: