Q1 4_1和4_2作为训练集 import pandas as pd train1 = pd.read_table('question_4_1.txt', sep='\t'...
Q1 4_1和4_2作为训练集 import pandas as pd train1 = pd.read_table('question_4_1.txt', sep='\t'...
train_data = train['sentiment'].values test_data = test['sentiment'].values plt.figure(...
from sklearn.ensemble import RandomForestClassifier import matplotlib.pyplot as plt imp...
4_3作为测试集 test = pd.read_table('question_4_3.txt', sep='\t', header=None) names = ['text...
4_1和4_2作为训练集 import pandas as pd train1 = pd.read_table('question_4_1.txt', sep='\t', h...
先贴写好的 import pandas as pd sentence_data = pd.read_table('question_4_1.txt', sep='\t', h...
第3小问 Elbow method k = 5 plt.figure(figsize=(10,5)) plt.plot() plt.scatter(product_df[:,...
第1小问 用KMeans product_df = pd.read_csv("question_2.csv",sep=';') product_df.head() from ...
抱歉,各位大佬。 第1问: 将3个dataframe以相同的列作为索引进行合并,列income_74,income_75,income_76不进行合并。 第2问: unemp...
income_df.describe() income_df['Training program'].value_counts() income_df['age'].valu...
第2问 income_df['unemployment'] = 0 第3问 income_df.to_csv('income.csv', ';')
import pandas as pd import numpy as np income_df1 = pd.read_csv("question_1_2_1.csv",se...