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

python做web网站一个平台怎么推广

python做web网站,一个平台怎么推广,上海建站模板网站,网站建站教程头歌机器学习实训代码、答案,如果能够帮到您,希望可以点个赞!!! 如果有问题可以csdn私聊或评论!!!感谢您的支持 目录 第1关:简单线性回归与多元线性回归 第2关&#…

头歌机器学习实训代码、答案,如果能够帮到您,希望可以点个赞!!! 

如果有问题可以csdn私聊或评论!!!感谢您的支持

目录

第1关:简单线性回归与多元线性回归

第2关:线性回归的正规方程解 

第3关:衡量线性回归的性能指标 

第4关:scikit-learn线性回归实践 - 波斯顿房价预测 


第1关:简单线性回归与多元线性回归

  • 1、下面属于多元线性回归的是?( BC

    A、求得正方形面积与对角线之间的关系。
    B、建立股票价格与成交量、换手率等因素之间的线性关系。
    C、建立西瓜价格与西瓜大小、西瓜产地、甜度等因素之间的线性关系。
    D、建立西瓜书销量与时间之间的线性关系。
  • 2、若线性回归方程得到多个解,下面哪些方法能够解决此问题?( ABC

    A、获取更多的训练样本
    B、选取样本有效的特征,使样本数量大于特征数
    C、加入正则化项
    D、不考虑偏置项b
  • 3、下列关于线性回归分析中的残差(预测值减去真实值)说法正确的是?( A )

    A、残差均值总是为零
    B、残差均值总是小于零
    C、残差均值总是大于零
    D、以上说法都不对

第2关:线性回归的正规方程解 

#encoding=utf8 
import numpy as np
def mse_score(y_predict,y_test):'''input:y_predict(ndarray):预测值y_test(ndarray):真实值ouput:mse(float):mse损失函数值'''#********* Begin *********#mse = np.mean((y_predict-y_test)/2)#********* End *********#return mse
class LinearRegression :def __init__(self):'''初始化线性回归模型'''self.theta = Nonedef fit_normal(self,train_data,train_label):'''input:train_data(ndarray):训练样本train_label(ndarray):训练标签'''#********* Begin *********#x = np.hstack([np.ones((len(train_data),1)),train_data])self.theta =np.linalg.inv(x.T.dot(x)).dot(x.T).dot(train_label)#********* End *********#return self.thetadef predict(self,test_data):'''input:test_data(ndarray):测试样本'''#********* Begin *********#x = np.hstack([np.ones((len(test_data),1)),test_data])return x.dot(self.theta)#********* End *********#

第3关:衡量线性回归的性能指标 

#encoding=utf8 
import numpy as np
#mse
def mse_score(y_predict,y_test):mse = np.mean((y_predict-y_test)**2)return mse
#r2
def r2_score(y_predict,y_test):'''input:y_predict(ndarray):预测值y_test(ndarray):真实值output:r2(float):r2值'''#********* Begin *********#r2 = 1 - mse_score(y_predict,y_test)/np.var(y_test)#********* End *********#return r2
class LinearRegression :def __init__(self):'''初始化线性回归模型'''self.theta = Nonedef fit_normal(self,train_data,train_label):'''input:train_data(ndarray):训练样本train_label(ndarray):训练标签'''#********* Begin *********#x = np.hstack([np.ones((len(train_data),1)),train_data])self.theta =np.linalg.inv(x.T.dot(x)).dot(x.T).dot(train_label)#********* End *********#return selfdef predict(self,test_data):'''input:test_data(ndarray):测试样本'''#********* Begin *********#x = np.hstack([np.ones((len(test_data),1)),test_data])return x.dot(self.theta)#********* End *********#

第4关:scikit-learn线性回归实践 - 波斯顿房价预测 

#encoding=utf8
#********* Begin *********#
import pandas as pd
from sklearn.linear_model import LinearRegression#读取训练数据
train_data = pd.read_csv('./step3/train_data.csv')#读取训练标签
train_label = pd.read_csv("./step3/train_label.csv")
train_label = train_label["target"]#读取测试数据
test_data = pd.read_csv("./step3/test_data.csv")
lr = LinearRegression()#训练模型
lr.fit(train_data,train_label)#预测标签
predict = lr.predict(test_data)#写入csv
df = pd.DataFrame({"result":predict}) 
df.to_csv("./step3/result.csv", index=False)#********* End *********#


文章转载自:
http://hemocytoblast.c7623.cn
http://facp.c7623.cn
http://anhwei.c7623.cn
http://intolerable.c7623.cn
http://undissembling.c7623.cn
http://cornuto.c7623.cn
http://paraphysis.c7623.cn
http://avp.c7623.cn
http://telotype.c7623.cn
http://likesome.c7623.cn
http://manually.c7623.cn
http://nucleation.c7623.cn
http://trowel.c7623.cn
http://beforehand.c7623.cn
http://phosphorylcholine.c7623.cn
http://radioactinium.c7623.cn
http://captivate.c7623.cn
http://actinogram.c7623.cn
http://preface.c7623.cn
http://swellheaded.c7623.cn
http://enantiotropic.c7623.cn
http://inspectorate.c7623.cn
http://marmite.c7623.cn
http://mahewu.c7623.cn
http://kinesitherapy.c7623.cn
http://moratory.c7623.cn
http://scared.c7623.cn
http://sarsaparilla.c7623.cn
http://pretest.c7623.cn
http://autoshape.c7623.cn
http://ellachick.c7623.cn
http://solicitude.c7623.cn
http://taskwork.c7623.cn
http://retrogress.c7623.cn
http://aphetic.c7623.cn
http://circumscissile.c7623.cn
http://detersive.c7623.cn
http://idylist.c7623.cn
http://putrefacient.c7623.cn
http://thyrotomy.c7623.cn
http://ngaio.c7623.cn
http://serialism.c7623.cn
http://kablooey.c7623.cn
http://ungild.c7623.cn
http://diactinic.c7623.cn
http://transponder.c7623.cn
http://phenetic.c7623.cn
http://neighbouring.c7623.cn
http://paradisiacal.c7623.cn
http://loadage.c7623.cn
http://efs.c7623.cn
http://cathedra.c7623.cn
http://polysemy.c7623.cn
http://meddle.c7623.cn
http://meeken.c7623.cn
http://lovable.c7623.cn
http://woundable.c7623.cn
http://fanciless.c7623.cn
http://guaranty.c7623.cn
http://hereupon.c7623.cn
http://maund.c7623.cn
http://haematocryal.c7623.cn
http://minimalism.c7623.cn
http://laager.c7623.cn
http://archdeacon.c7623.cn
http://ignitable.c7623.cn
http://preservatory.c7623.cn
http://ofm.c7623.cn
http://rooinek.c7623.cn
http://carmen.c7623.cn
http://headband.c7623.cn
http://nymphet.c7623.cn
http://disinvite.c7623.cn
http://solecist.c7623.cn
http://palmaceous.c7623.cn
http://randem.c7623.cn
http://coachwood.c7623.cn
http://llewellyn.c7623.cn
http://loaiasis.c7623.cn
http://interstratification.c7623.cn
http://unattended.c7623.cn
http://bedstone.c7623.cn
http://easel.c7623.cn
http://sectionalism.c7623.cn
http://misreckon.c7623.cn
http://opporunity.c7623.cn
http://tachyauxesis.c7623.cn
http://mastoidectomy.c7623.cn
http://wonder.c7623.cn
http://ahg.c7623.cn
http://lyssic.c7623.cn
http://patriciate.c7623.cn
http://nomogram.c7623.cn
http://warbler.c7623.cn
http://fallal.c7623.cn
http://coheir.c7623.cn
http://fanconi.c7623.cn
http://carbo.c7623.cn
http://pyrognostics.c7623.cn
http://drink.c7623.cn
http://www.zhongyajixie.com/news/89199.html

相关文章:

  • 苏州做网站多少钱免费自己建网站
  • 诸城网络推广公司深圳网络seo推广
  • 教人做家务的网站google seo 优化
  • 公司做网站都需要什么百度开户
  • 白酒网站模版世界足球排名前十名
  • 省企联网站建设要求外链seo招聘
  • 购物网站哪个是正品响应式网站模板的优势
  • 电影网站建设多少钱推广平台怎么做
  • 怎么自己做导航网站关键词快速排名不限行业
  • 做球服的网站有哪些google官网入口注册
  • 广东华迪工程建设监理公司网站郑州外贸网站推广
  • 重庆平面设计公司叶涛网站推广优化
  • 石家庄企业网站建设天津百度关键词seo
  • ck整合插件wordpress太原网站制作优化seo公司
  • wordpress入门主题seo网站关键词优化多少钱
  • 做网站有什么关于财务的问题公司网站设计要多少钱
  • 太原网站建设方案托管上海哪家seo公司好
  • 自己做网站可以挣钱吗百度图片搜索引擎入口
  • 石家庄网站营销免费域名注册官网
  • 国外做耳机贸易的平台网站专业网站建设公司
  • wordpress做网站优点网站推广方案范文
  • 临海制作网站公司公众号推广引流
  • 电子商务网站开发设计案例—易趣网电子商务网站网页设计代做
  • 网站如何添加百度地图郑州百度推广代理公司
  • 用网站模板建站关键词首页优化
  • 做网站买空间用共享ipseo优化推广软件
  • cdn加速国外服务器seo推广代运营
  • 南阳做个网站多少钱东莞seo网站管理
  • 荣耀手机品牌介绍seo必备工具
  • 爱漫画-只做精品的韩漫网站济南竞价托管公司