【发布时间】:2021-06-17 19:49:43
【问题描述】:
我使用来自 scikit-learn DecisionTreeRegressor 的predict 尝试对一些疯狂三月的统计数据进行建模,但我真的不知道我的结果意味着什么。
predict 函数预测什么?它是对列中接下来的内容的估计还是像矩阵一样解决它?
from sklearn.tree import DecisionTreeRegressor
model = DecisionTreeRegressor(random_state=1)
model.fit(x, y)
#file_path_test = '/content/sample_data/MM_Prediction_21 - Sheet5.csv'
data_test = pd.read_csv(file_path)
x1 = data_test[features]
print(model.predict(x1.head()))
【问题讨论】:
-
predict 函数预测什么,预测给定数据的标签或值。
-
一个 ML 模型从您在训练期间给他的示例 X_train 和 y_train 中“学习”,并尝试从中构建模型。然后它将模型应用于您提供的新 X_new 并要求他预测 y_new 值。
-
好的,那么当您尝试阅读文档时发生了什么?您对机器学习有任何背景了解吗?
标签: python machine-learning scikit-learn decision-tree