stanford Python

参考自http://www.johnwittenauer.net/machine-learning-exercises-in-python-part-1/

一、环境的安装(anaconda)

    第一步安装开发环境,windows下使用anaconda一键傻瓜式安装  

 

二、数据集

     从https://github.com/jdwittenauer/ipython-notebooks上下载下来后有data文件夹

 

三、part 1

 使用jupter打开..\..\..\ipython-notebooks-master\notebooks\ml\-Exercise1.ipynb   练习一的参考笔记

使用Spyder作为开发环境。输入并运行:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#%matplotlib inline
import os
path = 'F:\ML\ipython-notebooks-master\data\ex1data1.txt'
data = pd.read_csv(path, header=None, names=['Population', 'Profit'])
data.head() 
data.describe()
data.plot(kind='scatter',x='Population',y='Profit',figsize=(12,8))

 

 #sl

 

posted @ 2016-09-02 12:43  Viewsky  阅读(211)  评论(0编辑  收藏  举报