Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/pytest_optimization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ jobs:
python -m pytest ./tests/test_opti_bayesian_cdrec.py
python -m pytest ./tests/test_opti_bayesian_iim.py
python -m pytest ./tests/test_opti_bayesian_mrnn.py
python -m pytest ./tests/test_opti_bayesian_stmvl.py
python -m pytest ./tests/test_opti_bayesian_stmvl.py
python -m pytest ./tests/test_opti_greedy_cdrec.py
93 changes: 33 additions & 60 deletions .idea/workspace.xml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion env/default_values.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ load_series_contamination = []
load_missing_rate_contamination = "0"

[colors]
chart = ["#696969", "#2b908f", "#a6c96a", "#876d5d", "#8f10ba", "#f7a35c", "#434348", "#f15c80", "#910000", "#8085e9", "#365e0c", "#90ed7d"]
chart = ["#696969", "#2b908f", "#a6c96a", "#876d5d", "#8f10ba", "#f7a35c", "#434348", "#f15c80", "#910000", "#8085e9", "#365e0c", "#90ed7d"]
plot = ['dimgrey', 'plum', 'lightblue', 'mediumseagreen', 'khaki', 'gold', 'darkslategrey', 'hotpink', 'chocolate', 'lightseagreen', 'wheat']
Binary file modified imputegap/algorithms/__pycache__/min_impute.cpython-312.pyc
Binary file not shown.
Binary file modified imputegap/algorithms/__pycache__/zero_impute.cpython-312.pyc
Binary file not shown.
5 changes: 2 additions & 3 deletions imputegap/algorithms/min_impute.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import numpy as np


def min_impute(ground_truth, contamination, params=None):
def min_impute(contamination, params=None):
"""
Impute NaN values with the minimum value of the ground truth time series.

:param ground_truth: original time series without contamination
:param contamination: time series with contamination
:param params: [Optional] parameters of the algorithm, if None, default ones are loaded

:return: imputed_matrix : all time series with imputation data
"""

# logic
min_value = np.nanmin(ground_truth)
min_value = np.nanmin(contamination)

# Imputation
imputed_matrix = np.nan_to_num(contamination, nan=min_value)
Expand Down
3 changes: 1 addition & 2 deletions imputegap/algorithms/zero_impute.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import numpy as np


def zero_impute(ground_truth, contamination, params=None):
def zero_impute(contamination, params=None):
"""
Template zero impute for adding your own algorithms
@author : Quentin Nater

:param ground_truth: original time series without contamination
:param contamination: time series with contamination
:param params: [Optional] parameters of the algorithm, if None, default ones are loaded

Expand Down
Binary file added imputegap/assets/TimeSeriesData_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Binary file not shown.
Binary file added imputegap/assets/contamination_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion imputegap/assets/gt/.gitkeep

This file was deleted.

Binary file removed imputegap/assets/gt/test_gt.png
Binary file not shown.
Empty file.
Binary file removed imputegap/assets/imputation/test_imputation.png
Binary file not shown.
Binary file added imputegap/assets/imputation_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imputegap/assets/raw_data_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imputegap/assets/shap/eeg_cdrec_DTL_Beeswarm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imputegap/assets/shap/eeg_cdrec_DTL_Waterfall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions imputegap/assets/shap/eeg_cdrec_results.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Feature : 6 cdrec with a score of 28.43 Geometry Proportion of high incremental changes in the series MD_hrv_classic_pnn40
Feature : 1 cdrec with a score of 17.63 Geometry 10-bin histogram mode DN_HistogramMode_10
Feature : 8 cdrec with a score of 12.38 Geometry Transition matrix column variance SB_TransitionMatrix_3ac_sumdiagcov
Feature : 17 cdrec with a score of 9.72 Trend Entropy of successive pairs in symbolized series SB_MotifThree_quantile_hh
Feature : 15 cdrec with a score of 8.46 Transformation Power in the lowest 20% of frequencies SP_Summaries_welch_rect_area_5_1
Feature : 10 cdrec with a score of 6.81 Geometry Goodness of exponential fit to embedding distance distribution CO_Embed2_Dist_tau_d_expfit_meandiff
Feature : 13 cdrec with a score of 4.88 Geometry Positive outlier timing DN_OutlierInclude_p_001_mdrmd
Feature : 4 cdrec with a score of 4.43 Correlation Histogram-based automutual information (lag 2, 5 bins) CO_HistogramAMI_even_2_5
Feature : 0 cdrec with a score of 3.19 Geometry 5-bin histogram mode DN_HistogramMode_5
Feature : 5 cdrec with a score of 2.38 Correlation Time reversibility CO_trev_1_num
Feature : 20 cdrec with a score of 0.67 Transformation Centroid frequency SP_Summaries_welch_rect_centroid
Feature : 21 cdrec with a score of 0.49 Trend Error of 3-point rolling mean forecast FC_LocalSimple_mean3_stderr
Feature : 14 cdrec with a score of 0.3 Geometry Negative outlier timing DN_OutlierInclude_n_001_mdrmd
Feature : 18 cdrec with a score of 0.19 Geometry Rescaled range fluctuation analysis (low-scale scaling) SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1
Feature : 2 cdrec with a score of 0.04 Correlation First 1/e crossing of the ACF CO_f1ecac
Feature : 3 cdrec with a score of 0.0 Correlation First minimum of the ACF CO_FirstMin_ac
Feature : 7 cdrec with a score of 0.0 Geometry Longest stretch of above-mean values SB_BinaryStats_mean_longstretch1
Feature : 9 cdrec with a score of 0.0 Trend Wangs periodicity metric PD_PeriodicityWang_th0_01
Feature : 11 cdrec with a score of 0.0 Correlation First minimum of the AMI function IN_AutoMutualInfoStats_40_gaussian_fmmi
Feature : 12 cdrec with a score of 0.0 Correlation Change in autocorrelation timescale after incremental differencing FC_LocalSimple_mean1_tauresrat
Feature : 16 cdrec with a score of 0.0 Geometry Longest stretch of decreasing values SB_BinaryStats_diff_longstretch0
Feature : 19 cdrec with a score of 0.0 Geometry Detrended fluctuation analysis (low-scale scaling) SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imputegap/assets/shap/eeg_cdrec_shap_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imputegap/assets/shap/eeg_iim_DTL_Beeswarm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imputegap/assets/shap/eeg_iim_DTL_Waterfall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions imputegap/assets/shap/eeg_iim_results.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Feature : 17 iim with a score of 24.43 Trend Entropy of successive pairs in symbolized series SB_MotifThree_quantile_hh
Feature : 0 iim with a score of 14.07 Geometry 5-bin histogram mode DN_HistogramMode_5
Feature : 10 iim with a score of 9.91 Geometry Goodness of exponential fit to embedding distance distribution CO_Embed2_Dist_tau_d_expfit_meandiff
Feature : 4 iim with a score of 9.7 Correlation Histogram-based automutual information (lag 2, 5 bins) CO_HistogramAMI_even_2_5
Feature : 14 iim with a score of 9.52 Geometry Negative outlier timing DN_OutlierInclude_n_001_mdrmd
Feature : 15 iim with a score of 9.39 Transformation Power in the lowest 20% of frequencies SP_Summaries_welch_rect_area_5_1
Feature : 6 iim with a score of 7.59 Geometry Proportion of high incremental changes in the series MD_hrv_classic_pnn40
Feature : 1 iim with a score of 3.46 Geometry 10-bin histogram mode DN_HistogramMode_10
Feature : 5 iim with a score of 3.31 Correlation Time reversibility CO_trev_1_num
Feature : 21 iim with a score of 2.34 Trend Error of 3-point rolling mean forecast FC_LocalSimple_mean3_stderr
Feature : 8 iim with a score of 2.25 Geometry Transition matrix column variance SB_TransitionMatrix_3ac_sumdiagcov
Feature : 13 iim with a score of 2.0 Geometry Positive outlier timing DN_OutlierInclude_p_001_mdrmd
Feature : 18 iim with a score of 1.76 Geometry Rescaled range fluctuation analysis (low-scale scaling) SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1
Feature : 20 iim with a score of 0.19 Transformation Centroid frequency SP_Summaries_welch_rect_centroid
Feature : 2 iim with a score of 0.07 Correlation First 1/e crossing of the ACF CO_f1ecac
Feature : 3 iim with a score of 0.0 Correlation First minimum of the ACF CO_FirstMin_ac
Feature : 7 iim with a score of 0.0 Geometry Longest stretch of above-mean values SB_BinaryStats_mean_longstretch1
Feature : 9 iim with a score of 0.0 Trend Wangs periodicity metric PD_PeriodicityWang_th0_01
Feature : 11 iim with a score of 0.0 Correlation First minimum of the AMI function IN_AutoMutualInfoStats_40_gaussian_fmmi
Feature : 12 iim with a score of 0.0 Correlation Change in autocorrelation timescale after incremental differencing FC_LocalSimple_mean1_tauresrat
Feature : 16 iim with a score of 0.0 Geometry Longest stretch of decreasing values SB_BinaryStats_diff_longstretch0
Feature : 19 iim with a score of 0.0 Geometry Detrended fluctuation analysis (low-scale scaling) SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imputegap/assets/shap/eeg_iim_shap_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imputegap/assets/shap/eeg_iim_shap_trend_plot.png
Binary file added imputegap/assets/shap/eeg_mrnn_DTL_Beeswarm.png
Binary file added imputegap/assets/shap/eeg_mrnn_DTL_Waterfall.png
22 changes: 22 additions & 0 deletions imputegap/assets/shap/eeg_mrnn_results.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Feature : 10 mrnn with a score of 19.52 Geometry Goodness of exponential fit to embedding distance distribution CO_Embed2_Dist_tau_d_expfit_meandiff
Feature : 6 mrnn with a score of 16.45 Geometry Proportion of high incremental changes in the series MD_hrv_classic_pnn40
Feature : 1 mrnn with a score of 14.88 Geometry 10-bin histogram mode DN_HistogramMode_10
Feature : 15 mrnn with a score of 9.65 Transformation Power in the lowest 20% of frequencies SP_Summaries_welch_rect_area_5_1
Feature : 5 mrnn with a score of 7.37 Correlation Time reversibility CO_trev_1_num
Feature : 4 mrnn with a score of 7.12 Correlation Histogram-based automutual information (lag 2, 5 bins) CO_HistogramAMI_even_2_5
Feature : 8 mrnn with a score of 6.6 Geometry Transition matrix column variance SB_TransitionMatrix_3ac_sumdiagcov
Feature : 17 mrnn with a score of 5.15 Trend Entropy of successive pairs in symbolized series SB_MotifThree_quantile_hh
Feature : 13 mrnn with a score of 5.14 Geometry Positive outlier timing DN_OutlierInclude_p_001_mdrmd
Feature : 0 mrnn with a score of 2.57 Geometry 5-bin histogram mode DN_HistogramMode_5
Feature : 18 mrnn with a score of 1.9 Geometry Rescaled range fluctuation analysis (low-scale scaling) SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1
Feature : 14 mrnn with a score of 1.78 Geometry Negative outlier timing DN_OutlierInclude_n_001_mdrmd
Feature : 21 mrnn with a score of 1.2 Trend Error of 3-point rolling mean forecast FC_LocalSimple_mean3_stderr
Feature : 2 mrnn with a score of 0.44 Correlation First 1/e crossing of the ACF CO_f1ecac
Feature : 20 mrnn with a score of 0.23 Transformation Centroid frequency SP_Summaries_welch_rect_centroid
Feature : 3 mrnn with a score of 0.0 Correlation First minimum of the ACF CO_FirstMin_ac
Feature : 7 mrnn with a score of 0.0 Geometry Longest stretch of above-mean values SB_BinaryStats_mean_longstretch1
Feature : 9 mrnn with a score of 0.0 Trend Wangs periodicity metric PD_PeriodicityWang_th0_01
Feature : 11 mrnn with a score of 0.0 Correlation First minimum of the AMI function IN_AutoMutualInfoStats_40_gaussian_fmmi
Feature : 12 mrnn with a score of 0.0 Correlation Change in autocorrelation timescale after incremental differencing FC_LocalSimple_mean1_tauresrat
Feature : 16 mrnn with a score of 0.0 Geometry Longest stretch of decreasing values SB_BinaryStats_diff_longstretch0
Feature : 19 mrnn with a score of 0.0 Geometry Detrended fluctuation analysis (low-scale scaling) SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1
Binary file added imputegap/assets/shap/eeg_mrnn_shap_plot.png
Binary file added imputegap/assets/shap/eeg_stmvl_DTL_Beeswarm.png
Binary file added imputegap/assets/shap/eeg_stmvl_DTL_Waterfall.png
22 changes: 22 additions & 0 deletions imputegap/assets/shap/eeg_stmvl_results.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Feature : 13 stmvl with a score of 26.33 Geometry Positive outlier timing DN_OutlierInclude_p_001_mdrmd
Feature : 17 stmvl with a score of 18.35 Trend Entropy of successive pairs in symbolized series SB_MotifThree_quantile_hh
Feature : 6 stmvl with a score of 15.92 Geometry Proportion of high incremental changes in the series MD_hrv_classic_pnn40
Feature : 0 stmvl with a score of 7.55 Geometry 5-bin histogram mode DN_HistogramMode_5
Feature : 10 stmvl with a score of 5.47 Geometry Goodness of exponential fit to embedding distance distribution CO_Embed2_Dist_tau_d_expfit_meandiff
Feature : 4 stmvl with a score of 5.3 Correlation Histogram-based automutual information (lag 2, 5 bins) CO_HistogramAMI_even_2_5
Feature : 14 stmvl with a score of 5.27 Geometry Negative outlier timing DN_OutlierInclude_n_001_mdrmd
Feature : 1 stmvl with a score of 4.78 Geometry 10-bin histogram mode DN_HistogramMode_10
Feature : 15 stmvl with a score of 2.45 Transformation Power in the lowest 20% of frequencies SP_Summaries_welch_rect_area_5_1
Feature : 2 stmvl with a score of 2.35 Correlation First 1/e crossing of the ACF CO_f1ecac
Feature : 21 stmvl with a score of 2.28 Trend Error of 3-point rolling mean forecast FC_LocalSimple_mean3_stderr
Feature : 5 stmvl with a score of 2.17 Correlation Time reversibility CO_trev_1_num
Feature : 8 stmvl with a score of 0.97 Geometry Transition matrix column variance SB_TransitionMatrix_3ac_sumdiagcov
Feature : 20 stmvl with a score of 0.42 Transformation Centroid frequency SP_Summaries_welch_rect_centroid
Feature : 18 stmvl with a score of 0.4 Geometry Rescaled range fluctuation analysis (low-scale scaling) SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1
Feature : 3 stmvl with a score of 0.0 Correlation First minimum of the ACF CO_FirstMin_ac
Feature : 7 stmvl with a score of 0.0 Geometry Longest stretch of above-mean values SB_BinaryStats_mean_longstretch1
Feature : 9 stmvl with a score of 0.0 Trend Wangs periodicity metric PD_PeriodicityWang_th0_01
Feature : 11 stmvl with a score of 0.0 Correlation First minimum of the AMI function IN_AutoMutualInfoStats_40_gaussian_fmmi
Feature : 12 stmvl with a score of 0.0 Correlation Change in autocorrelation timescale after incremental differencing FC_LocalSimple_mean1_tauresrat
Feature : 16 stmvl with a score of 0.0 Geometry Longest stretch of decreasing values SB_BinaryStats_diff_longstretch0
Feature : 19 stmvl with a score of 0.0 Geometry Detrended fluctuation analysis (low-scale scaling) SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1
Binary file added imputegap/assets/shap/eeg_stmvl_shap_plot.png
Binary file added imputegap/assets/shap/ts_cdrec_DTL_Beeswarm.png
Loading
Loading