imputegap.recovery.downstream package

Module contents

class imputegap.recovery.downstream.Downstream(input_data, recov_data, incomp_data, algorithm, downstream)[source]

Bases: object

A class to evaluate the performance of imputation algorithms using downstream analysis.

This class provides tools to assess the quality of imputed time series data by analyzing the performance of downstream forecasting models. It computes metrics such as Mean Absolute Error (MAE) and Mean Squared Error (MSE) and visualizes the results for better interpretability.

ImputeGAP downstream models for forcasting : [‘arima’, ‘bats’, ‘croston’, ‘deepar’, ‘ets’, ‘exp-smoothing’, ‘hw-add’, ‘lightgbm’, ‘lstm’, ‘naive’, ‘nbeats’, ‘prophet’, ‘sf-arima’, ‘theta’, ‘transformer’, ‘unobs’, ‘xgboost’]

Attributes

input_datanumpy.ndarray

The original time series without contamination (ground truth).

recov_datanumpy.ndarray

The imputed time series to evaluate.

incomp_datanumpy.ndarray

The time series with contamination (NaN values).

downstreamdict

Configuration for the downstream analysis, including the evaluator, model, and parameters.

splitfloat

The proportion of data used for training in the forecasting task (default is 0.8).

Methods

__init__(input_data, recov_data, incomp_data, downstream)

Initializes the Downstream class with the provided data and configuration.

downstream_analysis()

Performs downstream analysis, computes metrics, and optionally visualizes results.

_plot_downstream(y_train, y_test, y_pred, incomp_data, title=”Ground Truth vs Predictions”, max_series=4)

Static method to plot ground truth vs. predictions for contaminated series.

downstream_analysis()[source]

Compute a set of evaluation metrics with a downstream analysis

ImputeGAP downstream models for forcasting : [‘arima’, ‘bats’, ‘croston’, ‘deepar’, ‘ets’, ‘exp-smoothing’, ‘hw-add’, ‘lightgbm’, ‘lstm’, ‘naive’, ‘nbeats’, ‘prophet’, ‘sf-arima’, ‘theta’, ‘transformer’, ‘unobs’, ‘xgboost’]

Returns

dict or None

Metrics from the downstream analysis or None if no valid evaluator is provided.