会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
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日
sklearn中的朴素贝叶斯模型及其应用
摘要: 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日
Kmeanns图片压缩
摘要: 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日
聚类K-Means
摘要: 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日
阶段作业1:完整的中英文词频统计+补交上次作业
摘要: #补交作业 #此次作业
阅读全文
posted @ 2018-10-15 11:03 C22C
阅读(210)
评论(0)
推荐(0)
编辑
2018年10月14日
numpy数据集练习
摘要: 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数组及处理:效率对比
摘要: #numpy多维数组的效率对比
阅读全文
posted @ 2018-10-14 17:15 C22C
阅读(553)
评论(0)
推荐(0)
编辑
下一页
Copyright © 2024 C22C
Powered by .NET 8.0 on Kubernetes