<jupyter_start><jupyter_text>Evaluation of Euclidian Distance Metric Setup<jupyter_code>all_data = pd.read_csv("../../files/classification/MSE/artfic_max_minus_60percent.csv", sep=";")
all_data.head()<jupyter_output><empty_output><jupyter_text>Evaluation Metrics F1-score<jupyter_code>f1_score = calculate_score(all_data, "f1_score", 2)
print("F1 score: {}".format(f1_score[0]))<jupyter_output>F1 score: 0.12703583061889248<jupyter_text>Precision Score<jupyter_code>precision_score = calculate_score(all_data, "precision_score", 2)
print("Precision score: {}".format(precision_score[0]))
print(precision_score)<jupyter_output>precision sensor_0    0.094203
precision sensor_1    0.047856
dtype: float64<jupyter_text>Recall Score<jupyter_code>recall_score = calculate_score(all_data, "recall_score", 2)
print("Recall score: {}".format(recall_score[0]))
print(recall_score)<jupyter_output>recall sensor_0    0.195
recall sensor_1    0.080
dtype: float64<jupyter_text>Confusion Matrix Sensor with errors<jupyter_code>print("Positive --> Anomaly")
print("Negative --> Normal Behaviour")
print("--"*15)
tn, fp, fn, tp = get_confusion_matrix(all_data, 2, 0)
print("Sensor No. {}:".format(1))
print("True negative: {}".format(tn))
print("False positive: {}".format(fp))
print("False negative: {}".format(fn))
print("True positive: {}".format(tp))<jupyter_output>Positive --> Anomaly
Negative --> Normal Behaviour
------------------------------
Sensor No. 1:
True negative: 10225
False positive: 1125
False negative: 483
True positive: 117<jupyter_text>Sensor without errors<jupyter_code>print("Positive --> Anomaly")
print("Negative --> Normal Behaviour")
print("--"*15)
tn, fp, fn, tp = get_confusion_matrix(all_data, 2, 1)
print("Sensor No. {}:".format(2))
print("True negative: {}".format(tn))
print("False positive: {}".format(fp))
print("False negative: {}".format(fn))
print("True positive: {}".format(tp))<jupyter_output>Positive --> Anomaly
Negative --> Normal Behaviour
------------------------------
Sensor No. 2:
True negative: 10947
False positive: 1003
False negative: 0
True positive: 0
{'fraction_non_alphanumeric': 0.1806020066889632, 'fraction_numerical': 0.047778308647873864, 'mean_word_length': 6.220689655172414, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '636019', 'license': 'MIT', 'n_tokens_mistral': 804, 'n_tokens_neox': 719, 'n_words': 147, 'path': 'src/visualisation/evaluation/MSE/evaluation_artifical_2_signals.ipynb', 'repo_name': 'carlov93/predictive_maintenance', 'size': '2093'}