welcome


  • 首页

  • 归档

  • 标签

  • 关于

  • 周易

  • 修仙

  • 搜索

机器学习3

发表于 2018-01-31

小疑问

1、 Expected n_neighbors <= n_samples, but n_samples = 4, n_neighbors = 5 ?

1
knn =KNeighborsClassifier(n_neighbors = 2)
明确指出分成2类,估计默认为5类

2、excel大空格字体排左下?

底端对齐,左对齐

3、TypeError: train() takes from 0 to 2 positional arguments but 3 were given

1
2
def train(datasetX=[],k=1):
def train(self, datasetX = [], k=1):
需加入self参数

4、代码高亮?区块暗?

三点对齐行首。文字部分小方块。

机器学习2

发表于 2018-01-30

小疑问

1、DataPreProcessing有什么用?

目前不需要用,为以后用

2、kmeans要分析什么?哪些数据是输入哪些数据是输出?

聚类分析,自己定义参数

3、main函数怎么来写?

目前只需要写类

4、y_pre = KMeans(n_clusters=3,random_state = random_state)什么意思?random_state?

5、from sklearn.externals import joblib ?

6、(n_clusters=9)?

9类

7、with open(‘cc_kmean.pkl’,’wb’) as f: ?

1
2
3
4
5
6
try:
f = open('/path/to/file', 'r')
print(f.read())
finally:
if f:
f.close()
这和前面的try ... finally是一样的,但是代码更佳简洁,并且不必调用f.close()方法。

8、iris?

数据集

9、iris = datasets.load_iris() ??

python自带的数据集

10、python main函数怎么写?

1
2
if __name__=="__main__":
print 'main'

11、python类如何使用?

1
k_means = K_means()

12、takes 2 positional arguments but 3 were given

13、[:,:-1]??

14、x = np.random.rand(3,2)??

15、需要知道这些算法是怎么实现的

knn,kmens,adbost,贝叶斯算法,c4.5,cart

16、datasets

1
2
3
4
from sklearn import datasets
iris = datasets.load_iris()
data = iris.data
data.shape

17、cmd清屏

1
cls

8、np.unique(iris_Y) ???

19、np.random.seed(0)

20、TypeError: list indices must be integers or slices, not tuple

indice 指数    tuple 元组
1
2
3
4
iris_X_test=[
[1, 1, 1, 1, 0, 0],
[0, 0, 0, 0, 1, 1]
]
这玩意儿之间少了逗号就会报这种错误

hello

发表于 2018-01-29

Today is Monday,and it is raining outside.hello everyone,this is my first article ,hhh.
welcome to mysite !

年?

发表于 2018-01-29

“找到了女朋友吗?”
“毕业后从事什么工作呢?”
“考试考了多少分?”
“大学感觉怎么样?”
春节依旧,寒暄依旧。
去了一趟东乡,风景依旧。还是曾经的地貌,曾经的人来人往。鱼塘还是那个样子,水库的水依旧清澈不见底。我出生时,计划生育抓得紧,被好心人收养,一住就是三年。想当年,我也是哭过七天七夜的男人…
问年味为何物?
爆竹声,划拳声,声声入耳。

Hello World

发表于 2018-01-29

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

1…56
weihuan

weihuan

55 日志
11 标签
© 2026 weihuan
由 Hexo 强力驱动
主题 - NexT.Muse