跟着Leo机器学习:sklearn之Naive Bayes
一个很有趣的个人博客,不信你来撩 fangzengye.com
sklearn 框架

函数导图

1.9. Naive Bayes
1.9.1. Gaussian Naive Bayes
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
X, y = load_iris(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=0)
gnb = GaussianNB()
y_pred = gnb.fit(X_train, y_train).predict(X_test)
print("Number of mislabeled points out of a total %d points : %d"
% (X_test.shape[0], (y_test != y_pred).sum()))
源地址
https://scikit-learn.org/stable/modules/gaussian_process.html
我的个人博客fangzengye.com, 欢迎来撩哦!
原文博主: 热衷开源的宝藏Boy
版权声明: 自由转载-非商用-禁止演绎-保持署名| CC BY-NC-ND 3.0
浙公网安备 33010602011771号