当前位置: 首页 > news >正文

生成wap网站qq群引流推广平台

生成wap网站,qq群引流推广平台,免费企业名录搜索软件,php做动态网站建设scikit-plot是基于sklearn和Matplotlib的库,主要的功能是对训练好的模型进行可视化。 安装: pip install scikit-plot 功能1:评估指标可视化 scikitplot.metrics.plot_confusion_matrix快速展示模型预测结果和标签计算得到的混淆矩阵。 im…

scikit-plot是基于sklearn和Matplotlib的库,主要的功能是对训练好的模型进行可视化。

安装:

pip install scikit-plot

功能1:评估指标可视化

scikitplot.metrics.plot_confusion_matrix快速展示模型预测结果和标签计算得到的混淆矩阵。

import scikitplot as skpltrf = RandomForestClassifier()rf = rf.fit(X_train, y_train)y_pred = rf.predict(X_test)skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)plt.show()


scikitplot.metrics.plot_roc快速展示模型预测的每个类别的ROC曲线。

 

 

import scikitplot as skplt
nb = GaussianNB()
nb = nb.fit(X_train, y_train)
y_probas = nb.predict_proba(X_test)skplt.metrics.plot_roc(y_test, y_probas)
plt.show()

scikitplot.metrics.plot_precision_recall从标签和概率生成PR曲线

 

import scikitplot as skplt
nb = GaussianNB()
nb.fit(X_train, y_train)
y_probas = nb.predict_proba(X_test)skplt.metrics.plot_precision_recall(y_test, y_probas)
plt.show()

scikitplot.metrics.plot_calibration_curve绘制分类器的矫正曲线

 

import scikitplot as skplt
rf = RandomForestClassifier()
lr = LogisticRegression()
nb = GaussianNB()
svm = LinearSVC()
rf_probas = rf.fit(X_train, y_train).predict_proba(X_test)
lr_probas = lr.fit(X_train, y_train).predict_proba(X_test)
nb_probas = nb.fit(X_train, y_train).predict_proba(X_test)
svm_scores = svm.fit(X_train, y_train).decision_function(X_test)
probas_list = [rf_probas, lr_probas, nb_probas, svm_scores]
clf_names = ['Random Forest', 'Logistic Regression','Gaussian Naive Bayes', 'Support Vector Machine']skplt.metrics.plot_calibration_curve(y_test,probas_list,clf_names)
plt.show()

功能2:模型可视化

scikitplot.estimators.plot_learning_curve生成不同训练样本下的训练和测试学习曲线图

import scikitplot as skplt
rf = RandomForestClassifier()skplt.estimators.plot_learning_curve(rf, X, y)
plt.show()

 scikitplot.estimators.plot_feature_importances可视化特征重要性。

 

import scikitplot as skplt
rf = RandomForestClassifier()
rf.fit(X, y)skplt.estimators.plot_feature_importances(rf, feature_names=['petal length', 'petal width','sepal length', 'sepal width'])
plt.show()

功能3:聚类可视化

  • scikitplot.cluster.plot_elbow_curve展示聚类的肘步图。

 

import scikitplot as skplt
kmeans = KMeans(random_state=1)skplt.cluster.plot_elbow_curve(kmeans, cluster_ranges=range(1, 30))
plt.show()

功能4:降维可视化

  • scikitplot.decomposition.plot_pca_component_variance绘制 PCA 分量的解释方差比。
import scikitplot as skplt
pca = PCA(random_state=1)
pca.fit(X)skplt.decomposition.plot_pca_component_variance(pca)plt.show()

 scikitplot.decomposition.plot_pca_2d_projection绘制PCA降维之后的散点图。

import scikitplot as skplt
pca = PCA(random_state=1)
pca.fit(X)skplt.decomposition.plot_pca_2d_projection(pca, X, y)
plt.show()

 principle components(主成分)是通过线性变换从原始数据中提取出来的新变量。主成分是原始数据的线性组合,通过这种方式,它们能够捕捉到数据中的最大方差。

PCA的目标是将高维数据转换为一组低维的主成分,这些主成分将数据中的方差解释得尽可能好。第一个主成分解释了最大的方差,第二个主成分解释了次大的方差,以此类推。每个主成分都是关于原始特征的线性组合,并且它们之间是正交的(相互之间不相关)。

主成分类似于原始数据的投影,但是它们的排序是如此安排,以便第一个主成分解释了最大的方差,第二个主成分解释了次大的方差,以此类推。这允许我们选择在最小信息损失的情况下保留具有最高方差的主要特征,并减少数据的维度。

http://www.15wanjia.com/news/22783.html

相关文章:

  • 什么网站可以做章百度网站网址是多少
  • 网站维护的要求包括哪些线下推广有哪几种渠道
  • 汕头网站建设制作厂家seo推广培训中心
  • 登封网站制作网站建设北京百度竞价托管公司
  • 中华人民共和国住房与建设部网站数据分析师35岁以后怎么办
  • 自己弄网站需要多少钱百度竞价代理公司
  • 网站建设运营方案 团队seo免费自学的网站
  • 静态网站如何做优化网站排名seo培训
  • 个人怎么做公司网站软文营销经典案例200字
  • 先备案 做网站网络营销优化推广公司
  • 用php做一网站有哪些东西优化排名 生客seo
  • 企业建设门户网站的目的推广渠道怎么写
  • 公众号做微网站郑州网站优化
  • 怎么样做电商赚钱武汉网站优化公司
  • 做网站生成二维码网络营销论坛
  • 做外语网站的公司搜索引擎优化英文简称为
  • 网站建设服务费怎么做会计分录如何给公司做网络推广
  • 昆山高端网站建设免费行情网站大全搜狐网
  • 修改网站版权长沙网站定制
  • 卢湾做网站国际羽联最新排名
  • 微网站免费制作百度一下你就知道官方网站
  • 怎么创造免费网站太原优化排名推广
  • 做流量网站合肥网络推广平台
  • 做母婴产品的网站口碑营销的形式
  • 网站后期的维护管理武汉楼市最新消息
  • ip地址或域名查询网站排名seo教程
  • 宣城高端网站建设惠州seo关键词推广
  • 住房城乡建设委官方网站seo工资服务
  • 做一些网站的弹出页面百度竞价排名机制
  • java 网站开发 顺序培训心得模板