def train_model(text_matrix, categories):
# model = AdaBoostClassifier(
# DecisionTreeClassifier(max_depth=3),
# n_estimators=500,
# algorithm="SAMME")
model = RandomForestClassifier(n_estimators=100, max_depth=8)
model.fit(text_matrix, categories)
return model
评论列表
文章目录