# -*- coding: utf-8 -*-
# *** Spyder Python Console History Log ***

##---(Sat Oct 01 09:22:57 2016)---
runfile('C:/Users/Administrator/.spyder/temp.py', wdir='C:/Users/Administrator/.spyder')

##---(Sat Oct 08 14:12:34 2016)---
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/simple-matplotlib04.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')

##---(Sat Oct 08 14:49:33 2016)---
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/simple-matplotlib04.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')

##---(Sat Oct 08 19:47:08 2016)---
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/1.8.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/web_descent_gradient00.py', wdir='C:/Users/Administrator/.spyder/00ll')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/gradient_descent01.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/example08.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/example06.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/example02.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/example03.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/iteration_plus.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/iteration_plus.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/1.8.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/iteration_mins.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/1.8.5.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/1.8.6.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/1.8.5.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/exercise.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/1.8.5.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/1.8.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/1.8.5.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/exercise.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/1.8.6.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/exercise.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/batch_gradient_descent_algorithm01.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/batch_gradient_descent_algorithm_a.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/batch_gradient_descent_algorithm01.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/batch_gradient_descent_algorithm_a.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')

##---(Mon Oct 10 11:36:03 2016)---
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import KNN
c:\python2.7\python.exe
import KNN
c:\Python2.7.12\Anaconda 4.2.0
C:/Users/Administrator/.spyder
C:/Users/Administrator/.spyder
from numpy import *
import operator
def creatDataSet():
    group=arry([[1.0,1.1],[1.0,1.0],[0,0],[0,0.1]])
    labels=['A','A','B','B']
    return group,labels
group,labels = KNN.creatDataSet()
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/batch_gradient_descent_algorithm_a.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/exercise.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/iteration_mins.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/example01.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/example02.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/example03.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/example02.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
a= [1,2,3]
b=tile(a,2)
b
a=(1,2,3)
b=tile(a,(3,1))
b
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise2.2.1.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/example02.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/exampl.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')

##---(Wed Oct 12 11:24:23 2016)---
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/example03.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/1.3.4.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise2.2.1.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/exampl.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import kNN
group,labels = kNN.createDateSet()
group,labels = kNN.createDataSet()
group
labels
import KNN_exercise2.2.1
import KNN
import exampl
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea/exampl.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/.idea')
import exampl
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise2.2.1.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
import KNN_exercise2.2.1
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import KNN
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import KNN
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import KNN
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import KNN

##---(Wed Oct 12 18:55:37 2016)---
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import KNN
import kNN
group,labels = kNN.creatDataSet()
group,labels = kNN.createDataSet()
group
labels
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
reload(kNN)
reload (kNN)
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
reload (KNN)
import (kNN)
import(kNN)
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
kNN.classify0([0,0],group,labels,3)
reload(kNN)
import kNN
reload(kNN)
datingDataMat,datingLabels = kNN.file2matrix('datingTestSet.txt')
import kNN
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/untitled0.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')

##---(Fri Oct 14 15:28:02 2016)---
import kNN
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import kNN
reload(kNN)
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise2.2.1.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
import kNN_exercise2.2.1
import kNN_exercise_my
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise_my.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
import kNN_exercise_my
import KNN_exercise_my
reload(KNN_exercise_my)
datingDataMat, datingLabels = KNN_exercise_my.file2matrix('datingTestSet.txt')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise_my.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
reload(KNN_exercise_my)
import KNN_exercise_my
reload(KNN_exercise_my)
datingDataMat, datingLabels = KNN_exercise_my.file2matrix('datingTestSet.txt')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise_my.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
reload(KNN_exercise_my)
import KNN_exercise_my
reload(KNN_exercise_my)
datingDataMat, datingLabels = KNN_exercise_my.file2matrix('datingTestSet.txt')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise_my.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
import KNN_exercise_my
reload(KNN_exercise_my)
datingDataMat, datingLabels = KNN_exercise_my.file2matrix('datingTestSet.txt')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise_my.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
import KNN_exercise_my
reload(KNN_exercise_my)
datingDataMat, datingLabels = KNN_exercise_my.file2matrix('datingTestSet.txt')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise_my.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
import KNN_exercise_my
reload(KNN_exercise_my)
datingDataMat, datingLabels = KNN_exercise_my.file2matrix('datingTestSet.txt')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise_my.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
import KNN_exercise_my
reload(KNN_exercise_my)
datingDataMat, datingLabels = KNN_exercise_my.file2matrix('datingTestSet.txt')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/KNN_exercise_my.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
import KNN_exercise_my
reload(KNN_exercise_my)
datingDataMat, datingLabels = KNN_exercise_my.file2matrix('datingTestSet.txt')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import kNN
reload(kNN)
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import kNN
reload(kNN)
datingDataMat, datingLabels = kNN.file2matrix('datingTestSet.txt')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
debugfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
debugfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
debugfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
debugfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')

##---(Fri Oct 14 18:58:05 2016)---
debugfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
debugfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
debugfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import kNN
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import kNN
reload(kNN)
datingDataMat,datingLabels = kNN.file2matrix('datingTestSet.txt')
datingDataMat
datingLabels[0:20]
import matplotlib
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.scatter(datingData[:1],datingDataMat[:,2])
ax.scatter(datingDataMat[:1],datingDataMat[:,2])
ax.scatter(datingDataMat[:,1],datingDataMat[:,2])
plt.show()
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02/kNN.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/Ch02')
import matplotlib
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.scatter(datingDataMat[:,1],datingDataMat[:,2])
plt.show()
import kNN

##---(Sat Oct 29 10:35:22 2016)---
runfile('C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09/untitled0.py', wdir='C:/Users/Administrator/.spyder/00ll/2016.09.10/2016.10.09')
import untitled0
xArr, yArr = untitled0.loadDataSet('abalone.txt')
untitled0.stageWise(xArr,yArr,0.01,100)
untitled0.stageWise(xArr,yArr)
import untitled0
xArr, yArr = untitled0.loadDataSet('abalone.txt')
untitled0.stageWise(xArr,yArr)