Feeding a time variable to dataiku.Model().get_predictor().predict()

razan Partner, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 6 Partner

Hello everyone

I want to make new predictions using `dataiku.Model().get_predictor().predict()` method for a time series forecasting model, but when I feed the model I receive the following error :


Here is a sample code:

#Get model predictorndvi_forecasting = dataiku.Model('ShrDQIQq')ndvi_predictor = ndvi_forecasting.get_predictor()prediction_params = {'temp': df.temp[0],'pressure': df.pressure[0],'cloudcover': df.cloudcover[0],'capture_date': df.capture_date[0],'humidity': df.humidity[0]}def make_predictions(predictor, data):prediction = predictor.predict(data)return predictionmake_predictions(ndvi_predictor, prediction_params)

I tried to simulate the source code step shown in the error, the out put is in the attached photo.

 pd.to_datetime(data[self.scoring_handler.time_variable], utc=True).dt.tz_localize(tz=None)

Should I pass the data as dictionary or should I use pass it in a different way?

Operating system used: ubuntu22

Setup Info
      Help me…