华盛顿大学机器学习基础:案例研究week2
来源:互联网 发布:什么是网络电视机 编辑:程序博客网 时间:2024/05/16 05:18
利用Python学习简单的数据操作
import graphlabsales = graphlab.SFrame('home_data.gl/')#exploring the data for housing salesgraphlab.canvas.set_target('ipynb')sales.show(view="Scatter Plot",x="sqft_living",y="price")
#create a simple regression model of sqft_living to pricetrain_data,test_data = sales.random_split(.8,seed =0)#build the regression modelsqft_model = graphlab.linear_regression.create(train_data,target="price",features=['sqft_living'])
print(test_data['price'].mean())print(sqft_model.evaluate(test_data))
# let's show what our predictions look likeimport matplotlib.pyplot as plt%matplotlib inlineplt.plot(test_data['sqft_living'],test_data['price'],'.', test_data['sqft_living'],sqft_model.predict(test_data),'-')
sqft_model.get('coefficients')
# explore other features in the datamy_features=['bedrooms','bathrooms','sqft_living','sqft_lot','floors','zipcode']sales[my_features].show()
sales.show(view='BoxWhisker Plot',x='zipcode',y='price')
# build a regression model with more featuresmy_features_model = graphlab.regression.create(train_data,target='price',features=my_features)
print(sqft_model.evaluate(test_data))print(my_features_model.evaluate(test_data))
# apply learned models to predict prices of 3 houseshouse1 = sales[sales['id']=='5309101200']
<img src="rich.jpeg">#这个语句要写在esc+M下才能出现图片
# prediction for a second, fancier househouse2 = sales[sales['id']=='1925069082']
阅读全文
0 0
- 华盛顿大学机器学习基础:案例研究week2
- 华盛顿大学机器学习课程(个案研究法)
- 华盛顿大学机器学习3:聚类和相似度
- 华盛顿大学--初探深度学习
- datascience机器学习week2
- 机器学习week1-week2
- 机器学习笔记week2
- 华盛顿大学2:分类学习笔记
- Stanford 机器学习笔记 Week2
- Coursera机器学习 week2 assignment
- Coursera机器学习 Week2 笔记
- Stanford 机器学习 Week2 作业: Linear Regression
- 机器学习笔记week2(Andrew NG)
- [机器学习]week2编程作业:Linear Regression
- Coursera机器学习笔记(week2)
- coursera机器学习 week1&week2&week3 总结
- 机器学习在行业应用中的案例研究
- 机器学习入门系列02,Regression 回归:案例研究
- springcloud(第二篇)springcloud config 修改配置
- 按照Doxygen工具规范给程序添加注释
- pygame游戏之旅6:制作障碍
- Codeforces883F-Lost in Transliteration
- java集合框架
- 华盛顿大学机器学习基础:案例研究week2
- Graph Theory HDU
- 264. Ugly Number II
- Phaser API 总结
- 多线程之Executors工厂类创建线程
- 647. Palindromic Substrings(回文子字符串)
- python中的矩阵运算
- Filter(第二节)
- 数据库的基础概念知识