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

爱站seo工具包官网网络营销的方式有哪些?举例说明

爱站seo工具包官网,网络营销的方式有哪些?举例说明,试玩平台怎么做网站,顺义区专业网站制作网站建设def findLossAndSplit(x,y): # 我们用 x 来表示训练数据 # 我们用 y 来表示训练数据的label # x[i]表示训练数据的第i个特征 # x_i 表示第i个训练样本 # minLoss 表示最小的损失 minLoss Integet.max_value # feature 表示是训练的数据第几纬度的特征 feature 0 # split 表示… def findLossAndSplit(x,y): # 我们用 x 来表示训练数据 # 我们用 y 来表示训练数据的label # x[i]表示训练数据的第i个特征 # x_i 表示第i个训练样本 # minLoss 表示最小的损失 minLoss Integet.max_value # feature 表示是训练的数据第几纬度的特征 feature 0 # split 表示切分点的个数 split 0# M 表示 样本x的特征个数 for j in range(0,M):# 该维特征下特征值的每个切分点这里具体的切分方式可以自己定义for c in range(0,x[j]):L 0# 第一类R1 {x|x[j] c}# 第二类R2 {x|x[j] c}# 属于第一类样本的y值的平均值y1 ave{y|x 属于 R1}# 属于第二类样本的y值的平均值y2 ave{y| x 属于 R2}# 遍历所有的样本找到 loss funtion 的值for x_1 in all xif x_1 属于 R1 L (y_1 - y1)^2 else:L (y_1 - y2)^2if L minLoss:minLoss Lfeature isplit c return minLoss,feature ,split定义训练数据 train_data [[5.1,3.5,1.4,0.2],[4.9,3.0,1.4,0.2],[7.0,3.2,4.7,1.4],[6.4,3.2,4.5,1.5],[6.3,3.3,6.0,2.5],[5.8,2.7,5.1,1.9]] 定义label label_data [[1,0,0],[1,0,0],[0,1,0],[0,1,0],[0,0,1],[0,0,1]] index 表示的第几类 def findBestLossAndSplit(train_data,label_data,index): sample_numbers len(label_data) feature_numbers len(train_data[0]) current_label [] # define the minLossminLoss 10000000# feature represents the dimensions of the featurefeature 0# split represents the detail split valuesplit 0# get current labelfor label_index in range(0,len(label_data)):current_label.append(label_data[label_index][index])# trans all featuresfor feature_index in range(0,feature_numbers):## current feature valuecurrent_value []for sample_index in range(0,sample_numbers):current_value.append(train_data[sample_index][feature_index])L 0## different split valueprint current_valuefor index in range(0,len(current_value)):R1 []R2 []y1 0y2 0for index_1 in range(0,len(current_value)):if current_value[index_1] current_value[index]:R1.append(index_1)else:R2.append(index_1)## calculate the samples for first classsum_y 0for index_R1 in R1:sum_y current_label[index_R1]if len(R1) ! 0:y1 float(sum_y) / float(len(R1))else:y1 0## calculate the samples for second classsum_y 0for index_R2 in R2:sum_y current_label[index_R2]if len(R2) ! 0:y2 float(sum_y) / float(len(R2))else:y2 0## trans all samples to find minium loss and best splitfor index_2 in range(0,len(current_value)):if index_2 in R1:L float((current_label[index_2]-y1))*float((current_label[index_2]-y1))else:L float((current_label[index_2]-y2))*float((current_label[index_2]-y2))if L minLoss:feature feature_indexsplit current_value[index]minLoss Lprint minLossprint minLossprint splitprint splitprint featureprint featurereturn minLoss,split,featurefindBestLossAndSplit(train_data,label_data,0)
http://wiki.neutronadmin.com/news/205461/

相关文章:

  • 如何建立免费的网站网站制作相关知识
  • 合肥仿站定制模板建站网站建设责任分工
  • 汇川区住房和城乡建设厅网站如何制作微信小程序店铺
  • vps被攻击网站打不开ping值高下载中国最新军事新闻
  • 海口建设网站的公司哪家好个人网站界面设计图片
  • 西安做企业网站哪家做的好网站的类型
  • 点广告挣钱网站有哪些关于动漫的网站建设
  • 建设银行网站不能登录密码邯山手机网站建设
  • 内蒙古网站seo组合wordpress源码
  • 农业基本建设项目 网站建筑室内设计公司排名
  • 网站flash效果丹阳房产网二手房
  • 南京网站建设外包云南俊发建设集团网站
  • 十大素材网站建筑新网
  • 商店网站在线设计建设银行网站首页打
  • 智能外呼系统宁波seo网络优化哪家好
  • 烟台免费网站建设东莞网站优化
  • 营销型网站建设要多少钱企业网站建设软件需求分析
  • 百度网站首页百度公司是国企还是私企
  • 网站开发页面wordpress前台会员
  • 家政网站建设方案湖北省建设厅网站查询
  • 网站建设 上海wordpress 鼠标点击
  • 丹徒区建设局网站在线呼叫网页版
  • 推荐一下做图文的网站三星网上商城退款
  • 怎样做有效的黄页网站项目三的设计与制作
  • html5网站修改潍坊 网站推广
  • 广东的网站备案自己创建网站怎么得流量钱
  • 公司想做个自己的网站怎么做电子商务网站建设的流程图
  • 南昌 提供网站设计 公司免费查询营业执照
  • 基础网站开发学设计哪个网站好
  • 怎么做一个电子商务网站关键词搜索查找工具