Feeding a time variable to dataiku.Model().get_predictor().predict()
![razan](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar23.png)
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:
pd.to_datetime(data[self.scoring_handler.time_variable], utc=True).dt.tz_localize(tz=None)
I tried to simulate the source code step shown in the error, the out put is in the attached photo.
#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)
Should I pass the data as dictionary or should I use pass it in a different way?
Operating system used: ubuntu22