Hi, I'm currently working on a automated job to predict forecasts using a notebook than work just fine when I run it manually, but keep failling when schedueled, here is my code:
import mlflow
# Load model as a PyFuncModel.
loaded_model = mlflow.pyfunc.load_model(logged_model)
# Predict using the model
results_df = loaded_model.predict(predict_df)
# Define group_column and time_column
group_column = "id" # Replace with your actual group column name
time_column = "week_date_format" # Replace with your actual time column name
target_column = "sales_value"
# Display the prediction results with timestamp for each id
final_df = results_df.reset_index()[[group_column, time_column, "yhat"]].tail(
forecast_horizon * predict_df[group_column].nunique()
)
final_df = final_df.rename(columns={'yhat': target_column})
display(final_df)
The other cells where mflow is installed and model dependecies are working fyi.
PS: I use serverless job compute.