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

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

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 predictor
ndvi_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 prediction
make_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

0 Kudos
0 Replies