摘要:
1. from sklearn.datasets import load_boston data = load_boston() from sklearn.model_selection import train_test_split x_train, x_test, y_train, y_test 阅读全文
摘要:
from sklearn.datasets import load_boston boston = load_boston() print(boston.keys()) from sklearn.datasets import load_boston import matplotlib.pyplot 阅读全文
摘要:
import csv file_path = r'EmailData.txt' EmailData = open(file_path,'r',encoding='utf-8') Email_data = [] Email_target = [] csv_reader = csv.reader(Ema 阅读全文
摘要:
1.理解分类与监督学习、聚类与无监督学习。 简述分类与聚类的联系与区别。 聚类:是指事先没有“标签”而通过某种成团分析找出事物之间存在聚集性原因的过程。 分类:是根据文本的特征或属性,划分到已有的类别中。也就是说,这些类别是已知的,通过对已知分类的数据进行训练和学习,找到这些不同类的特征,再对未分类 阅读全文
摘要:
1 from sklearn.datasets import load_sample_image from sklearn.cluster import KMeans import matplotlib.pyplot as plt china = load_sample_image("china.j 阅读全文
摘要:
fo = open("1.txt", "r", encoding='utf-8')read = fo.read()fo.close()read = read.strip().lower()for i in '''.,?;:''': read = read.replace(i, ' ')readLis 阅读全文
摘要:
a = list('nihao') # 列表的遍历 print(a) for i in a: print(i) b = tuple('12323') # 元组的遍历 print(b) for i in b: print(i) c = set('kjkjhg') # 集合的遍历 print(c) fo 阅读全文