Arcana Prediction

Submodules

arcana.prediction.quantile_prediction module

This module contains the class that predicts with the quantile model

class arcana.prediction.quantile_prediction.QuantilePredictor(arcana_procedure, test_data, pretrained_model)

Bases: object

Predicting with the quantile model

apply_correct_exogenous()

Apply the correct exogenous data

calculate_metrics()

Calculate the metrics of the predictions

metrics_preparation()

Prepare the metrics for prediction

plot_analysis(sample_number)

Plot the analysis of the prediction

Parameters:

sample_number (int) – sample number

plot_predictions()

Helper function that plots the predictions

predict_data_preparation(num_steps_to_predict, sample_number, len_available_label)

Prepare the data for prediction

Parameters:
  • num_steps_to_predict (int) – number of steps to predict

  • sample_number (int) – sample number

  • len_available_label (int) – length of the available sequence

predict_quantiles(num_steps_to_predict, sample_number, len_available_label)

Predict the quantiles. This function also saves the attention weights and sensitivity scores

Parameters:
  • num_steps_to_predict (int) – number of steps to predict

  • sample_number (int) – sample number

  • len_available_label (int) – length of the available sequence

save_attention()

Save the attention weights

save_metrics()

Helper function that saves the metrics

save_predictions()

Save the predictions

save_sensitivity()

Save the sensitivity scores

save_transformed_predictions()

Helper function that saves the transformed predictions

transform_predictions_to_numpy()

Helper function that transform the predictions to numpy and to original scale

arcana.prediction.quantile_prediction.metrics_helper(target_labels, predict_labels)

Helper function that calculates the metrics

Parameters:
  • target_labels (numpy array) – target labels

  • predict_labels (numpy array) – predicted labels

Returns:
  • mse_score (float) – mean squared error

  • rmse_score (float) – root mean squared error

  • mape_score (float) – mean absolute percentage error

  • mae_score (float) – mean absolute error

Module contents