cc013陈文朋  

2018年12月23日

摘要: from sklearn.datasets import load_boston boston=load_boston() x=boston.data y=boston.target x.shape from sklearn.preprocessing import PolynomialFeatures poly=PolynomialFeatures(degree=2)#多项式的度 度越小曲... 阅读全文
posted @ 2018-12-23 21:55 C22C 阅读(141) 评论(0) 推荐(0) 编辑

2018年12月10日

摘要: from sklearn.datasets import load_boston boston = load_boston() boston.keys() dict_keys(['data', 'target', 'feature_names', 'DESCR']) print(boston.DESCR) data=boston.data x=data[:,5] y=boston.targ... 阅读全文
posted @ 2018-12-10 11:33 C22C 阅读(268) 评论(0) 推荐(0) 编辑

2018年12月3日

摘要: # 若没有nltk则先定义一个空函数 def pre(text): pre_text=text return pre_text #读取数据 import csv # with open(r'd:/SMSSpamCollectionjsn.txt',encoding = "utf-8")as file_path: # with open('C:\Users\Administrat... 阅读全文
posted @ 2018-12-03 16:03 C22C 阅读(216) 评论(0) 推荐(0) 编辑

2018年11月27日

摘要: from sklearn import datasets iris=datasets.load_iris() from sklearn.naive_bayes import GaussianNB gnb=GaussianNB() pred=gnb.fit(iris.data,iris.target) y_pred=pred.predict(iris.data) print(iris.data.s... 阅读全文
posted @ 2018-11-27 20:01 C22C 阅读(225) 评论(0) 推荐(0) 编辑

2018年11月21日

摘要: from pandas import read_csv from sklearn.model_selection import KFold from sklearn.model_selection import cross_val_score from sklearn.naive_bayes import GaussianNB #导入数据 filename = 'C:/Users/lenovo/... 阅读全文
posted @ 2018-11-21 22:31 C22C 阅读(202) 评论(0) 推荐(0) 编辑

2018年11月13日

摘要: from sklearn.datasets import load_sample_image#先导入数据包 china = load_sample_image("china.jpg")#从包中拿出china那那张图 print(china.shape) china array([[[174, 201, 231], [174, 201, 231], [174, ... 阅读全文
posted @ 2018-11-13 20:59 C22C 阅读(127) 评论(0) 推荐(0) 编辑

2018年11月5日

摘要: import numpy as np x=np.random.randint(0,52,52) x k=3 y=np.zeros(20) y array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]) ... 阅读全文
posted @ 2018-11-05 20:23 C22C 阅读(170) 评论(0) 推荐(0) 编辑

2018年10月15日

摘要: #补交作业 #此次作业 阅读全文
posted @ 2018-10-15 11:03 C22C 阅读(210) 评论(0) 推荐(0) 编辑

2018年10月14日

摘要: import numpy as np l=list(range(10)) a=np.arange(10) b=np.array([a,2*a]) print(type(l),type(a),type(b),type(l[0]),type(a[0]),a.dtype,b.dtype) l.append("xiaodudu") print(l) a.reshape(2,5) ... 阅读全文
posted @ 2018-10-14 20:49 C22C 阅读(222) 评论(0) 推荐(0) 编辑
 
摘要: #numpy多维数组的效率对比 阅读全文
posted @ 2018-10-14 17:15 C22C 阅读(553) 评论(0) 推荐(0) 编辑