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

seo做的好的网站开发公司计算实际成本含土地费的税金吗

seo做的好的网站,开发公司计算实际成本含土地费的税金吗,wordpress怎么设计网站,天津外贸网站建设什么是决策阈值#xff1f; sklearn不允许我们直接设置决策阈值#xff0c;但它允许我们访问用于进行预测的决策分数#xff08;决策函数o/p#xff09;。我们可以从决策函数输出中选择最佳得分并将其设置为决策阈值#xff0c;并且将小于该决策阈值的所有那些决策得分值…什么是决策阈值 sklearn不允许我们直接设置决策阈值但它允许我们访问用于进行预测的决策分数决策函数o/p。我们可以从决策函数输出中选择最佳得分并将其设置为决策阈值并且将小于该决策阈值的所有那些决策得分值视为负类0并且将大于该决策阈值的所有那些决策得分值视为正类1。 对各种决策阈值使用精度-召回曲线我们可以选择最佳的决策阈值使它提供高精度不影响召回很多或高召回不影响精度很多的基础上根据我们的项目是面向精度还是面向召回的。 这样做的主要目的是得到一个高精度ML模型或高召回ML模型。 用于构建高精度ML模型的Python代码 # Import required modules. import pandas as pd import matplotlib.pyplot as plt from sklearn import datasets from sklearn.model_selection import train_test_split from sklearn.svm import SVC from sklearn.metrics import classification_report, recall_score, precision_score, accuracy_score# Get the data. data_set datasets.load_breast_cancer()# Get the data into an array form. x data_set.data # Input feature x. y data_set.target # Input target variable y.# Get the names of the features. feature_list data_set.feature_names# Convert the data into pandas data frame. data_frame pd.DataFrame(x, columns feature_list)# To insert an output column in data_frame. data_frame.insert(30, Outcome, y) # Run this line only once for every new training.# Data Frame. data_frame.head(7) 训练模型 # Train Test Split. x_train, x_test, y_train, y_test train_test_split(x, y, test_size 0.2, random_state 42)# Create Classifier Object. clf SVC() clf.fit(x_train, y_train)# Use decision_function method. decision_function clf.decision_function(x_test) 获得实际评分 # Actual obtained results without any manual setting of Decision Threshold. predict_actual clf.predict(x_test) # Predict using classifier. accuracy_actual clf.score(x_test, y_test) classification_report_actual classification_report(y_test, predict_actual) print(predict_actual, accuracy_actual, classification_report_actual, sep \n)在上面的分类报告中我们可以看到我们的模型精度值1是0.92召回值1是1.00。由于本文中我们的目标是在预测1时构建一个高精度ML模型而不影响召回率因此我们需要从下面的精确度-召回曲线中手动选择最佳的决策阈值值以便我们可以提高该模型的精度。 # Plot Precision-Recall curve using sklearn. from sklearn.metrics import precision_recall_curve precision, recall, threshold precision_recall_curve(y_test, decision_function)# Plot the output. plt.plot(threshold, precision[:-1], c r, label PRECISION) plt.plot(threshold, recall[:-1], c b, label RECALL) plt.grid() plt.legend() plt.title(Precision-Recall Curve) 在上面的图中我们可以看到如果我们想要高精度值那么我们需要增加决策阈值的值 X轴但这将降低召回值这是不利的。因此我们需要选择决策阈值它可以提高准确率但召回率不会下降太多。形成上述曲线的一个这样的值是大约0.6决策阈值。 # Implementing main logic.# Based on analysis of the Precision-Recall curve. # Let Decision Threshold value be around 0.6... to get high Precision without affecting recall much. # Desired results.# Decision Function output for x_test. df clf.decision_function(x_test)# Set the value of decision threshold. decision_teshold 0.5914643767268305# Desired prediction to increase precision value. desired_predict []# Iterate through each value of decision function output # and if decision score is than Decision threshold then, # append (1) to the empty list ( desired_prediction) else # append (0). for i in df:if idecision_teshold:desired_predict.append(0)else:desired_predict.append(1) 新旧精度值的比较 # Comparison# Old Precision Value print(old precision value:, precision_score(y_test, predict_actual)) # New precision Value print(new precision value:, precision_score(y_test, desired_predict)) 输出 old precision value: 0.922077922077922 new precision value: 0.9714285714285714结论 精度值从0.92增加到0.97。召回值因精度-召回权重而减少。 注 上面的代码没有经过数据预处理数据清理这只是一个在实践中如何使用决策阈值的想法。
http://www.hkea.cn/news/14259346/

相关文章:

  • 网站建设 .北京蓝纤网站中文域名到期有没有影响
  • 成都品牌网站建设最好的网站服务器
  • 怎么做企业销售网站中国比较有名的外贸公司
  • 服装业网站建设的策划百度网站首页入口
  • 天津站设计单位有网址 有空间怎么做网站
  • 网站空间多大合适深圳海圳公司官网
  • 教做甜点的网站郑州专业公司网站制作公司
  • 网站模仿算侵权吗设计微信小程序多少钱
  • 90设计网站是不是没有视频模板保定做网站
  • 有关网站建设的参考书手机版网站有必要吗
  • 青岛建设网站制作南通 网站建设
  • 自己如何高效有力的维护一个网站做设计及免费素材网站有哪些
  • 单页网站与传统网站的区别做360网站优化快速排
  • 网站seo优化报告贵安新区网站建设
  • 教育类网站怎么做子网站怎么做
  • 国外人像摄影网站转换成wordpress
  • 电子商务网站开发需求分析四川建设银行手机银行下载官方网站下载安装
  • 制作企业网站软件写作网站起点
  • 旅游网站建设主要工作wordpress七牛插件
  • 电商网站建设与管理实践wordpress本地添加图片不显示图片
  • 网站建设策划执行绍兴网络公司网站建设
  • 做儿童交互网站国内十大平面设计公司
  • 定制网站哪家好做网站公司经营范围
  • 做网站设计需要学什么网站创建于
  • 中南大学双一流建设网站深圳关键词推广优化
  • 宁波网站建设详细内容学网站建设多少学费
  • 太原网站制作最新招聘信息wordpress手机版 403
  • 维度网络做网站h5制作培训
  • 四川省工程建设信息网站可以直接进入的正能量网站老狼
  • 网站开发发送短信php wordpress 关系