Make predictions

Use the new federated model built from a completed session to generate predictions

Once the session is complete, the user can make predictions using the complete federated model using the following command in their terminal. This command is going to predict the target column and save the whole dataset with a filled target column as an output.

hfl predict --token $TOKEN --session-id <session_id> --dataset-path <data_path> --batch-size <batch_size> 
  1. <session_id> to reference the completed session

  2. <data_path> is the path of the data to make predictions on. Please use the absolute path of your dataset. eg: /root/demo/prediction_data.parquet. This data must contain all the predictor columns specified when training the model.

  3. <batch_size> batch size to load the data with. Must be an integer input.

The prediction output will be saved as file under the same directory as the input data with the file name <original_input_file_name>_<timestamp>

Now that you've created the session and made predictions on your model, please read about how to properly close out the session.

For custom models - if a user specifies a model prediction output that has more than two dimensions, it will be flattened into a two-dimensional table in order for results to be displayed via hfl predict, in the same order as they are outputted.

Last updated