Update heatmap of correlation matrix
parent
4d37696158
commit
f436f1f530
|
@ -65,6 +65,7 @@ rule heatmap_feature_correlation_matrix:
|
||||||
input:
|
input:
|
||||||
all_sensor_features = "data/processed/features/all_participants/all_sensor_features.csv" # before data cleaning
|
all_sensor_features = "data/processed/features/all_participants/all_sensor_features.csv" # before data cleaning
|
||||||
params:
|
params:
|
||||||
|
time_segments_type = config["TIME_SEGMENTS"]["TYPE"],
|
||||||
min_rows_ratio = config["HEATMAP_FEATURE_CORRELATION_MATRIX"]["MIN_ROWS_RATIO"],
|
min_rows_ratio = config["HEATMAP_FEATURE_CORRELATION_MATRIX"]["MIN_ROWS_RATIO"],
|
||||||
corr_threshold = config["HEATMAP_FEATURE_CORRELATION_MATRIX"]["CORR_THRESHOLD"],
|
corr_threshold = config["HEATMAP_FEATURE_CORRELATION_MATRIX"]["CORR_THRESHOLD"],
|
||||||
corr_method = config["HEATMAP_FEATURE_CORRELATION_MATRIX"]["CORR_METHOD"]
|
corr_method = config["HEATMAP_FEATURE_CORRELATION_MATRIX"]["CORR_METHOD"]
|
||||||
|
|
|
@ -17,12 +17,19 @@ def getCorrMatrixHeatmap(corr_matrix, time_segment, html_file):
|
||||||
html_file.write(fig.to_html(full_html=False, include_plotlyjs="cdn"))
|
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"]
|
min_rows_ratio = snakemake.params["min_rows_ratio"]
|
||||||
corr_threshold = snakemake.params["corr_threshold"]
|
corr_threshold = snakemake.params["corr_threshold"]
|
||||||
corr_method = snakemake.params["corr_method"]
|
corr_method = snakemake.params["corr_method"]
|
||||||
|
|
||||||
features = pd.read_csv(snakemake.input["all_sensor_features"])
|
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"])
|
time_segments = set(features["local_segment_label"])
|
||||||
|
|
||||||
html_file = open(snakemake.output[0], "a", encoding="utf-8")
|
html_file = open(snakemake.output[0], "a", encoding="utf-8")
|
||||||
|
|
Loading…
Reference in New Issue