Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在没有响应值的情况下使用xgboost模型根据预测值进行预测_Python_Database_Machine Learning_Data Science_Xgboost - Fatal编程技术网

Python 如何在没有响应值的情况下使用xgboost模型根据预测值进行预测

Python 如何在没有响应值的情况下使用xgboost模型根据预测值进行预测,python,database,machine-learning,data-science,xgboost,Python,Database,Machine Learning,Data Science,Xgboost,我已经用python创建了一个XGBoost模型,现在我想用它对一个全新的数据库进行预测。问题是我的新数据库有我所有的输入变量(特性),但它没有目标值 换句话说,我希望我的模型能够预测响应值,并根据输入变量告诉我,每个样本的目标值是多少?由于您的模型已经过训练,您不需要目标。你只想预测它们 让我们假设\u model=。。。您安装的XGBoost车型,而该款df2是您的新数据库,仅包含您的功能 df2['Predicted_target'] = _model.predict(df2) 这不是问

我已经用python创建了一个XGBoost模型,现在我想用它对一个全新的数据库进行预测。问题是我的新数据库有我所有的输入变量(特性),但它没有目标值


换句话说,我希望我的模型能够预测响应值,并根据输入变量告诉我,每个样本的目标值是多少?

由于您的模型已经过训练,您不需要目标。你只想预测它们

让我们假设
\u model=。。。您安装的XGBoost车型
,而该款df2是您的新数据库,仅包含您的功能

df2['Predicted_target'] = _model.predict(df2)

这不是问题;事实上,这正是我们首先制作ML模型的原因——如果它们只能应用于我们已经知道答案的数据集,那么它们就没有任何实际价值,对吗?