Skip to content

Commit cf81a5b

Browse files
committed
Little comment and some git clean up
1 parent 4d79f43 commit cf81a5b

File tree

4 files changed

+300013
-1
lines changed

4 files changed

+300013
-1
lines changed

‎.gitignore‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
*.pyc
22
ch06/twitterauth.py
3+
.idea/
4+
ch03/data/dataset-379-20news-18828_EYKCY.zip
5+
ch03/data/379/raw/alt.atheism/100-53167
6+
ch03/data/379/raw/
7+
ch03/data/379/
8+
ch03/charts/
9+
playGround/user-basket/data/raw_user.csv

‎ch03/noise_analysis.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def build_analyzer(self):
4040
forpostinpost_group]
4141
graphics=sorted([postforpostinallifpost[2] =='comp.graphics'])
4242
print(graphics[5])
43+
4344
# (245, 'From: [email protected]\nSubject: test....(sorry)\nOrganization:
4445
# The University of Birmingham, United Kingdom\nLines: 1\nNNTP-Posting-Host: ibm3090.bham.ac.uk
4546
# \n\n==============================================================================\n',

‎ch03/plot_kmeans_example.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# coding=utf-8
12
# This code is supporting material for the book
23
# Building Machine Learning Systems with Python
34
# by Willi Richert and Luis Pedro Coelho
@@ -26,6 +27,7 @@
2627
defplot_clustering(x, y, title, mx=None, ymax=None, xmin=None, km=None):
2728
pylab.figure(num=None, figsize=(8, 6))
2829
ifkm:
30+
# x,y 是数组,zip后变成一个元组的数列
2931
pylab.scatter(x, y, s=50, c=km.predict(list(zip(x, y))))
3032
else:
3133
pylab.scatter(x, y, s=50)
@@ -41,7 +43,8 @@ def plot_clustering(x, y, title, mx=None, ymax=None, xmin=None, km=None):
4143

4244
returnpylab
4345

44-
46+
# http://www.wolframalpha.com/input/?i=exp(-x**2%2F2)%2Fsqrt(2*pi)
47+
# 正态分布的随机数,一共20个。loc是分布的中心点
4548
xw1=norm(loc=0.3, scale=.15).rvs(20)
4649
yw1=norm(loc=0.3, scale=.15).rvs(20)
4750

0 commit comments

Comments
(0)