Update heatmap of correlation matrix

pull/147/head
Meng Li 2021-06-16 17:10:08 -04:00
parent 4d37696158
commit f436f1f530
2 changed files with 9 additions and 1 deletions

View File

@ -65,6 +65,7 @@ rule heatmap_feature_correlation_matrix:
input:
all_sensor_features = "data/processed/features/all_participants/all_sensor_features.csv" # before data cleaning
params:
time_segments_type = config["TIME_SEGMENTS"]["TYPE"],
min_rows_ratio = config["HEATMAP_FEATURE_CORRELATION_MATRIX"]["MIN_ROWS_RATIO"],
corr_threshold = config["HEATMAP_FEATURE_CORRELATION_MATRIX"]["CORR_THRESHOLD"],
corr_method = config["HEATMAP_FEATURE_CORRELATION_MATRIX"]["CORR_METHOD"]

View File

@ -17,12 +17,19 @@ def getCorrMatrixHeatmap(corr_matrix, time_segment, html_file):
html_file.write(fig.to_html(full_html=False, include_plotlyjs="cdn"))
time_segments_type = snakemake.params["time_segments_type"]
min_rows_ratio = snakemake.params["min_rows_ratio"]
corr_threshold = snakemake.params["corr_threshold"]
corr_method = snakemake.params["corr_method"]
features = pd.read_csv(snakemake.input["all_sensor_features"])
if time_segments_type == "FREQUENCY":
features["local_segment_label"] = features["local_segment_label"].str.split("\d+", expand=True, n=1)[0]
if time_segments_type == "EVENT":
features["local_segment_label"] = "event"
time_segments = set(features["local_segment_label"])
html_file = open(snakemake.output[0], "a", encoding="utf-8")