在Azure ML环境中使用xgboost

时间:2019-05-22 13:21:01

标签: python-3.x azure machine-learning

我无法成功在Azure Machine Learning Studio解释器中使用xgboost程序包。我正在尝试使用我训练过的xgboost导入模型,以便将其部署到此处。但是似乎我的软件包设置不正确,因为我无法访问某些功能,尤其是“ xgboost.sklearn”

我的模型当然是使用xgboost.sklearn.something进行分类的

我尝试通过以下两种不同的方法来实现该软件包: 来自tar.gz原理,例如: How can certain python libraries be imported in azure ML?Like the line import humanfriendly gives error

,也可以使用干净的沙盒包装,如下所示: Uploading xgboost to azure machine learning: %1 is not a valid Win32 application\r\nProcess returned with non-zero exit code 1

    import sys
    import sklearn
    import pandas as pd
    import pickle
    import xgboost 

    def azureml_main(dataframe1 = None, dataframe2 = None):

        sys.path.insert(0,".\Script Bundle")

        model = pickle.load(open(".\\Script 
    Bundle\\xgboost\\XGBv1.pkl",'rb'))

        dataframe1, dftrue = filterdata(dataframe1)
        ## one processing step

        pred = predictorV1(dataframe1,dftrue)
        dataframe1['Y'] = pred

        return dataframe1

这是我得到的错误

Error 0085: The following error occurred during script evaluation, please view the output log for more information:
---------- Start of error message from Python interpreter ----------
Caught exception while executing function: Traceback (most recent call last):
  File "C:\server\invokepy.py", line 199, in batch
    odfs = mod.azureml_main(*idfs)
  File "C:\temp\1098d8754a52467181a9509ed16de8ac.py", line 89, in azureml_main
    model = pickle.load(open(".\\Script Bundle\\xgboost\\XGBv1.pkl", 'rb'))
ImportError: No module named 'xgboost.sklearn'
Process returned with non-zero exit code 1

---------- End of error message from Python  interpreter  ----------
Start time: UTC 05/22/2019 13:11:08
End time: UTC 05/22/2019 13:11:49

0 个答案:

没有答案