阅读 301次
评论 1条
指尖的hacker
机器学习实战之贝叶斯之scikit-learn使用
机器学习 5个月前 4091字 301阅读
import numpy as np X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) Y = np.array([1, 1, 1, 2, 2, 2]) from sklearn.naive_bayes import GaussianNB clf = GaussianNB() #拟合数据 clf.fit(X, Y) print "==Predict result by predict==" print(clf.predict([[-0.8, -1]])) print "==Predict result by predict_proba==" print(clf.predict_proba([[-0.8, -1]])) print "==Predict result by predict_log_proba==" print(clf.predict_log_proba([[-0.8, -1]]))
菜鸟后飞 4个月前
行内公式要用 两个 $$ 公式 $$ 闭合, 才能生效。。
$$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$
(0) 回复 举报
©2017 studyai.com 版权所有
关于我们
菜鸟后飞 4个月前
行内公式要用 两个 $$ 公式 $$ 闭合, 才能生效。。
$$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$
(0) 回复 举报