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

南通网站建设哪家好六盘水seo

南通网站建设哪家好,六盘水seo,百度搜索推广开户,商品推广软文范例200字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.hkea.cn/news/477324/

相关文章:

  • 北京哪家做网站优化产品seo基础优化
  • 招商加盟网站建设百度网址安全检测
  • 知名做网站费用2024年将爆发新瘟疫
  • 河北省城乡与建设厅网站企业关键词排名优化哪家好
  • 网站开发合同协议百度百科推广费用
  • 推荐黄的网站产品推广策划
  • 济南网站建设设计公司线上运营推广
  • 小清新 wordpressseo排名是什么意思
  • 从客户—管理者为某一公司做一份电子商务网站管理与维护的方案自媒体是如何赚钱的
  • 黑龙江住房和城乡建设厅网站首页每日精选12条新闻
  • 做网站工作都包括什么企业网站搭建
  • 自己可以进行网站建设吗河北网站推广
  • 网站建设与管理论文seo整站怎么优化
  • 西安做网站收费价格网站流量监控
  • 福州网站制作有限公司南京疫情最新情况
  • 国外品牌设计网站天津疫情最新消息
  • 宁波有做网站的地方吗seo报价单
  • 深圳企业网站开发中国法律服务网app最新下载
  • 大连企业网站建站国外域名注册网站
  • 站长工具seo综合查询权重百度在线搜索
  • 伊犁网站建设评价怎样才能上百度
  • 房地产网站建设方案百度实名认证
  • 做外贸可以在哪些网站注册网络项目免费的资源网
  • 中国建设银行信用卡网站首页青岛关键词优化平台
  • 阿里云网站建设考试题目长沙网站推广服务公司
  • 甘肃建设项目审批权限网站俄罗斯搜索引擎yandex官网入口
  • 网站建设公司新员工培训ppt模板百度热门搜索排行榜
  • 仿魔客吧网站模板网址大全是ie浏览器吗
  • 网站产品后台界面怎么做湖南关键词排名推广
  • 网站数据每隔几秒切换怎么做的湖南百度seo排名点击软件