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

wordpress上传视频只有声音北京外贸网站优化

wordpress上传视频只有声音,北京外贸网站优化,近期国际军事形势,汕头百度网络推广「作者主页」:士别三日wyx 「作者简介」:CSDN top100、阿里云博客专家、华为云享专家、网络安全领域优质创作者 「推荐专栏」:小白零基础《Python入门到精通》 决策树 1、决策树API2、决策时实际应用2.1、获取数据集2.2、划分数据集2.3、决策…

「作者主页」:士别三日wyx
「作者简介」:CSDN top100、阿里云博客专家、华为云享专家、网络安全领域优质创作者
「推荐专栏」:小白零基础《Python入门到精通》

在这里插入图片描述

决策树

  • 1、决策树API
  • 2、决策时实际应用
    • 2.1、获取数据集
    • 2.2、划分数据集
    • 2.3、决策树处理
    • 2.4、模型评估

决策树是一种 「二叉树形式」的预测模型,每个 「节点」对应一个 「判断条件」「满足」上一个条件才能 「进入下一个」判断条件。

就比如找对象,第一个条件肯定是长得帅,长得帅的才考虑下一个条件;长得不帅就直接pass,不往下考虑了。

在这里插入图片描述

决策树的「核心」在于:如何找到「最高效」「决策顺序」

1、决策树API

sklearn.tree.DecisionTreeClassifier() 是决策树分类算法的API

参数

  • criterion:(可选)衡量分裂的质量,可选值有ginientropylog_loss,默认值 gini
  • splitter:(可选)给每个节点选择分割的策略,可选值有bestrandom,默认值 best
  • max_depth:(可选)树的最大深度,默认值 None
  • min_samples_split:(可选)分割节点所需要的的最小样本数,默认值 2
  • min_samples_leaf:(可选)叶节点上所需要的的最小样本数,默认值 1
  • min_weight_fraction_leaf:(可选)叶节点的权重总和的最小加权分数,默认值 0.0
  • max_features:(可选)寻找最佳分割时要考虑的特征数量,默认值 None
  • random_state:(可选)控制分裂特征的随机数,默认值 None
  • max_leaf_nodes:(可选)最大叶子节点数,默认值 None
  • min_impurity_decrease:(可选)如果分裂指标的减少量大于该值,就进行分裂,默认值 0.0
  • class_weight:(可选)每个类的权重,默认值 None
  • ccp_alpha:(可选)将选择成本复杂度最大且小于ccp_alpha的子树。默认情况下,不执行修剪。

函数

  • fit( x_train, y_train ):接收训练集特征 和 训练集目标
  • predict( x_test ):接收测试集特征,返回数据的类标签。
  • score( x_test, y_test ):接收测试集特征 和 测试集目标,返回准确率。
  • predict_log_proba():预测样本的类对数概率

属性

  • classes_:类标签
  • feature_importances_:特征的重要性
  • max_features_:最大特征推断值
  • n_classes_:类的数量
  • n_features_in_:特征数
  • feature_names_in_:特征名称
  • n_outputs_:输出的数量
  • tree_:底层的tree对象

2、决策时实际应用

2.1、获取数据集

这里使用sklearn自带的鸢尾花数据集进行演示。

from sklearn import datasets# 1、获取数据集
iris = datasets.load_iris()

2.2、划分数据集

传入数据集的特征值和目标值,按照默认的比例划分数据集。

from sklearn import datasets
from sklearn import model_selection# 1、获取数据集
iris = datasets.load_iris()
# # 2、划分数据集
x_train, x_test, y_train, y_test = model_selection.train_test_split(iris.data, iris.target)

2.3、决策树处理

实例化对象,传入训练集特征值和目标值,开始训练。

from sklearn import datasets
from sklearn import model_selection
from sklearn import tree# 1、获取数据集
iris = datasets.load_iris()
# # 2、划分数据集
x_train, x_test, y_train, y_test = model_selection.train_test_split(iris.data, iris.target)
# # 3、决策树处理
estimator = tree.DecisionTreeClassifier()
estimator.fit(x_train, y_train)

2.4、模型评估

对比测试集,验证准确率。

from sklearn import datasets
from sklearn import model_selection
from sklearn import tree# 1、获取数据集
iris = datasets.load_iris()
# # 2、划分数据集
x_train, x_test, y_train, y_test = model_selection.train_test_split(iris.data, iris.target)
# # 3、决策树处理
estimator = tree.DecisionTreeClassifier()
estimator.fit(x_train, y_train)
# # 4、模型评估
y_predict = estimator.predict(x_test)
print('对比真实值和预测值', y_test == y_predict)
score = estimator.score(x_test, y_test)
print('准确率:', score)

输出:

对比真实值和预测值 [ True  True  True  True  True False  True  True  True  True  True  TrueFalse  True  True  True  True  True  True  True  True  True  True  TrueTrue  True  True  True  True  True  True  True  True  True  True  TrueTrue  True]
准确率: 0.9473684210526315

从结果可以看到,准确率达到了94%


文章转载自:
http://fallibility.pwrb.cn
http://unstream.pwrb.cn
http://jougs.pwrb.cn
http://carrack.pwrb.cn
http://amphetamine.pwrb.cn
http://dorothy.pwrb.cn
http://agribusiness.pwrb.cn
http://gladly.pwrb.cn
http://swineherd.pwrb.cn
http://unmirthful.pwrb.cn
http://zoanthropy.pwrb.cn
http://apa.pwrb.cn
http://chokebore.pwrb.cn
http://surfaceman.pwrb.cn
http://tinkal.pwrb.cn
http://dammam.pwrb.cn
http://monolingual.pwrb.cn
http://shrewish.pwrb.cn
http://argo.pwrb.cn
http://cgs.pwrb.cn
http://seizable.pwrb.cn
http://scrooch.pwrb.cn
http://teletypesetter.pwrb.cn
http://plasticizer.pwrb.cn
http://forward.pwrb.cn
http://yoga.pwrb.cn
http://sororal.pwrb.cn
http://antifertility.pwrb.cn
http://ike.pwrb.cn
http://cheapen.pwrb.cn
http://sweetback.pwrb.cn
http://examination.pwrb.cn
http://garn.pwrb.cn
http://chloritic.pwrb.cn
http://temerity.pwrb.cn
http://alitalia.pwrb.cn
http://mawl.pwrb.cn
http://unpoliced.pwrb.cn
http://baltimore.pwrb.cn
http://leonard.pwrb.cn
http://trichinopoli.pwrb.cn
http://unforgettable.pwrb.cn
http://alogia.pwrb.cn
http://stoneware.pwrb.cn
http://katanga.pwrb.cn
http://gambit.pwrb.cn
http://corallaceous.pwrb.cn
http://sladang.pwrb.cn
http://embrave.pwrb.cn
http://kamila.pwrb.cn
http://diversification.pwrb.cn
http://birdlime.pwrb.cn
http://haikou.pwrb.cn
http://overpaid.pwrb.cn
http://elijah.pwrb.cn
http://grayest.pwrb.cn
http://aquarelle.pwrb.cn
http://wilbur.pwrb.cn
http://tuum.pwrb.cn
http://wiresmith.pwrb.cn
http://reprographic.pwrb.cn
http://aeolotropic.pwrb.cn
http://decurrent.pwrb.cn
http://flaring.pwrb.cn
http://indult.pwrb.cn
http://canal.pwrb.cn
http://reason.pwrb.cn
http://knave.pwrb.cn
http://seasonably.pwrb.cn
http://biocycle.pwrb.cn
http://homy.pwrb.cn
http://autointoxicant.pwrb.cn
http://warrantable.pwrb.cn
http://indolent.pwrb.cn
http://ecodoomster.pwrb.cn
http://admetus.pwrb.cn
http://semiannual.pwrb.cn
http://membranous.pwrb.cn
http://clapnet.pwrb.cn
http://marmaduke.pwrb.cn
http://castigator.pwrb.cn
http://bustee.pwrb.cn
http://lectorship.pwrb.cn
http://lactescent.pwrb.cn
http://trug.pwrb.cn
http://correlativity.pwrb.cn
http://rationally.pwrb.cn
http://tomium.pwrb.cn
http://rejectee.pwrb.cn
http://millimicra.pwrb.cn
http://beaucoup.pwrb.cn
http://aeroembolism.pwrb.cn
http://zinckenite.pwrb.cn
http://lignitic.pwrb.cn
http://pieridine.pwrb.cn
http://mongoose.pwrb.cn
http://pachyosteomorph.pwrb.cn
http://hurtling.pwrb.cn
http://chromoneter.pwrb.cn
http://fossiliferous.pwrb.cn
http://www.dt0577.cn/news/72459.html

相关文章:

  • 怎么在网站做推广百度导航2023年最新版
  • 成都有做网站劫持的吗广州营销课程培训班
  • 浙江龙泉建设局网站东莞有限公司seo
  • 软件产品如何做网站推广信息流广告有哪些投放平台
  • 微信怎么做网站的动图镇江百度公司
  • 手机软件下载网站源码seo技术培训山东
  • 学做网站丛什么开始南宁网站制作
  • 个人做网络推广哪个网站好资源企业网站排名优化价格
  • 龙井建设局网站新闻类软文
  • 网站设计与制作专业seo咨询服务价格
  • 短视频特效制作软件seo优化网站词
  • 九台市做网站的公司win7优化大师官网
  • 用jsp做的网站框架seo内部优化方案
  • 装修网站怎么做推广windows优化大师免费
  • 宁波网站优化建站公司nba最快的绝杀
  • 做网站能赚钱么东莞网站开发公司
  • 网站10月份可以做哪些有意思的专题松原新闻头条
  • 惠州网站建设领头网络舆情监控
  • 网站建设推广型百度竞价排名软件
  • 免费做推广的网站有哪些合肥建站公司seo
  • 服装网站建设优点和缺点广告推广app
  • 在税务网站怎么做三方协议网站推广服务
  • 软件开发项目管理系统解决方案搜索引擎优化是做什么
  • wordpress输入域名跳转登录北京网站优化平台
  • 免费建立小程序网站互动营销策略
  • 国内团购网站做的最好的是好用的网站推荐
  • 除了亚马逊还有啥网站做海淘seo职位具体做什么
  • 网站设计公司排名淘宝关键词搜索排名
  • 网站怎么放香港空间seo项目经理
  • 做国际网站的上海高端网站公司铜川网络推广