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

企业网站的建站步骤百度推广seo软件

企业网站的建站步骤,百度推广seo软件,网站改版设计流程,甘肃高端建设网站训练集 测试集如果拿所有原始数据来训练#xff0c;存在的问题#xff1a;模型很差无法调整#xff1b;真实环境难以拿到真实 label#xff1b;所以将数据区分为 训练数据 和 测试数据(train test split)#xff1b;将训练数据来训练模型#xff1b;然后用测试数据…训练集 测试集如果拿所有原始数据来训练存在的问题模型很差无法调整真实环境难以拿到真实 label所以将数据区分为 训练数据 和 测试数据(train test split)将训练数据来训练模型然后用测试数据测试模型使用这种方式也存在问题python 原生分离 iris 数据集import numpy as npfrom sklearn import datasetsimport matplotlib.pyplot as pltiris datasets.load_iris()X iris.datay iris.targetX(array([[5.1, 3.5, 1.4, 0.2],[4.9, 3. , 1.4, 0.2], ...[6.2, 3.4, 5.4, 2.3],[5.9, 3. , 5.1, 1.8]])yarray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])X.shape, y.shape #((150, 4), (150,))# shuffleshuffle_indexes np.random.permutation(len(X)) # 0--len(X) 的随机排列shuffle_indexes# array([ 22, 4, 142, 24, 7, 146, ... 9, 95, 130, 29, 124])test_ratio 0.2test_size int(len(X) * test_ratio)test_size # 30test_indexes shuffle_indexes[:test_size]train_indexes shuffle_indexes[test_size:]test_indexesarray([ 22, 4, 142, 24, 7, 146, 70, 77, 144, 14, 40, 119, 46, 85, 74, 87, 86, 60, 91, 120, 78, 45, 65, 105, 113, 39, 83, 80, 134, 16])X_train X[train_indexes]y_train y[train_indexes]X_test X[test_indexes]y_test y[test_indexes]X_test.shape, X_train.shape # ((30, 4), (120, 4))封装 train_test_split 函数def train_test_split(X, y, test_ratio0.2, seedNone):assert x.shape[0] y.shape[0], the size of X must be equal to the size of yassert 0.0 test_ratio 1.0, test_ ration must be validif seed:np.random.seed(seed)shuffle_indexes np.random.permutation(len(X))test_size int(len(X) * test_ratio)test_indexes shuffle_indexes[:test_size]train_indexes shuffle_indexes[test_size:]X_train X[train_indexes]y_train y[train_indexes]X_test X[test_indexes]y_test y[test_indexes]return X_train, y_train, X_test, y_testsklearn 中的 train_test_splitfrom sklearn.model_selection import train_test_splitX_train, X_test, y_train, y_test train_test_split(X, y)train_test_split(*arrays, **options)X_train, X_test, y_train, y_test train_test_split( X, y, test_size0.33, random_state42)
http://www.yutouwan.com/news/377120/

相关文章:

  • 网站开发方向c语言浙江网站建设推广
  • 网站上传教程下载官方大庆加油app软件
  • 石材外贸网站有哪些用wordpress
  • 两学一做纪实评价系统登陆网站免费咨询兽医
  • 个人网站后台模板wordpress 5开发接口
  • 楼盘销售管理网站开发资源重庆网站定制哪家好
  • 网站建设管理视频桂林北站改造
  • 个人网站示例设计门户网
  • 医药类网站建设评价知名企业官网设计公司
  • 上海帝程网站建设公司企业手机网站建设机构
  • 制学网网站网站营销建设
  • 用三权重的网站做友链有好处没百度关键字
  • 商业网站开发教程wordpress家具主题
  • 网站怎么做动态主图网站音乐播放器代码
  • 打开上次浏览的网站个人博客网站
  • 免费建立网站空间wordpress能放几个域名
  • 大型房产网站建设网站开发用什么语言开发的
  • 巴中交通建设有限公司网站潍坊市做网站
  • 网上建设银行网站首页做视频导航网站
  • 企业级网站建设企业类网页设计
  • 网站制作合肥千万别学服装设计
  • 物流网站建设实例微信分销app
  • 做网站很难吗海南省建设厅官方网站
  • 会员系统网站制作网站建设选哪家
  • ci框架的网站北京市建设工程交易服务中心网站
  • 大连网站优化步骤常熟网站制作设计
  • 个人网站域名备案流程江门建设局网站
  • 成都网站模板西安做网站程序
  • 北京网站建设好不好天大庆建设网站首页
  • 网页制作与网站建设论文wordpress页面导航菜单