代码改变世界

阅读排行榜

.编程实现朴素贝叶斯分类算法

2018-11-29 08:26 by 默默的卖萌, 567 阅读, 收藏,
摘要: import csvfile_path = r'F:\SMSSpamCollectionjs.txt'sms = open(file_path,'r',encoding = 'utf-8')sms_data = []sms_label = []csv_reader = csv.reader(sms, 阅读全文

K-means算法应用:图片压缩

2018-11-07 21:45 by 默默的卖萌, 477 阅读, 收藏,
摘要: from sklearn.datasets import load_sample_imagefrom sklearn.cluster import KMeansimport matplotlib.pyplot as pltimport numpy as npchina = load_sample_i 阅读全文

numpy统计分布显示

2018-10-20 23:58 by 默默的卖萌, 461 阅读, 收藏,
摘要: 计算鸢尾花花瓣长度的最大值,平均值,中值,均方差。 import numpy as npfrom sklearn.datasets import load_irisdata = load_iris()iris = data['data'][:,2]print(iris)d1 = np.max(iri 阅读全文

聚类--K均值算法:自主实现与sklearn.cluster.KMeans调用

2018-10-31 11:24 by 默默的卖萌, 444 阅读, 收藏,
摘要: import numpy as npx=np.random.randint(1,100,[20,1]) y=np.zeros(20) k=3def initcenter(x,k): return x[:k]kc=initcenter(x,k)kc 运行结果: 2) 对于样本中的数据对象,根据它们与这 阅读全文

用for循环产生的网址

2018-09-13 11:03 by 默默的卖萌, 354 阅读, 收藏,
摘要: for i in range(2,10): print('http://news.gzcc.cn/html/xiaoyuanxinwen/'+str(i)+'.html') 阅读全文