12 2018 档案

摘要:一、boston房价预测 二、中文文本分类 阅读全文
posted @ 2018-12-23 21:40 DT_TD 阅读(173) 评论(0) 推荐(0)
摘要:1. 导入boston房价数据集 2. 一元线性回归模型,建立一个变量与房价之间的预测模型,并图形化显示。 plt.figure(figsize=(10,6)) plt.scatter(x, y) w = LinR.coef_ b = LinR.intercept_ print(w, b) plt. 阅读全文
posted @ 2018-12-20 16:28 DT_TD 阅读(188) 评论(0) 推荐(0)
摘要:import os import jieba path=r'F:\duym\123' fs=os.listdir(path) for f in fs: fp=os.path.join(path,f) word=open (fp,'r',encoding='utf-8').read() for w in jieba.cut(word): print(w) # ji... 阅读全文
posted @ 2018-12-17 11:15 DT_TD 阅读(102) 评论(0) 推荐(0)
摘要:import csv # 读数据 file_path = r'D:\SMSSpamCollectionjsn.txt' smsData = open(file_path,'r',encoding='utf-8') E_data = [] E_target = [] csv_reader = csv.reader(smsData,delimiter='\t') # 将数据分别存入数据列表和目标分类... 阅读全文
posted @ 2018-12-05 22:04 DT_TD 阅读(247) 评论(0) 推荐(0)