<jupyter_start><jupyter_text>Evaluation  Setup<jupyter_code>all_data = pd.read_csv("../../files/classification/MSE/phm67_max_minus_60percent.csv", sep=";")
until_first_failure = all_data.loc[all_data["up time"]<=3807966]
all_failures_67 =[3807966., 3814610., 3815890., 3816362., 3856686., 3860122., 3865202., 3867646., 3868170.,
       3870094., 6539522., 6549554., 6572426., 6573162., 6574566., 6575118., 6575566., 6577254., 6582502., 6586022.]<jupyter_output><empty_output><jupyter_text>Model Evaluation F1 Score<jupyter_code>score = calculate_score(until_first_failure, "f1_score", 12)
print(score[0])<jupyter_output>0.3335278669390137<jupyter_text>Confusion Matrix<jupyter_code>print("Positive --> Anomaly")
print("Negative --> Normal Behaviour")
print("--"*15)
tp, fp, tn, fn = get_confusion_matrix_machine(until_first_failure, 12)
print("True negative: {}".format(tn[0]))
print("False positive: {}".format(fp[0]))
print("False negative: {}".format(fn[0]))
print("True positive: {}".format(tp[0]))<jupyter_output>Positive --> Anomaly
Negative --> Normal Behaviour
------------------------------
True negative: 56643
False positive: 800
False negative: 8336
True positive: 2286<jupyter_text>Sensetivity<jupyter_code>print(tn[0] / (tn[0] + fp[0]))<jupyter_output>0.9860731507755515<jupyter_text>Cumulative Sum of Anomaly, labeld by LSTM-Model<jupyter_code>subset_1 = artifical_data.iloc[0:75000,:]
failures_67_subset1 =[3807966., 3814610., 3815890., 3816362., 3856686., 3860122., 3865202., 3867646., 3868170., 3870094.]
vis_anomaly_detection(subset_1, 12, 1, 13, failures_67_subset1, line=True, training=True)
plt.show()
subset_2 = artifical_data.iloc[90000:150000,:]
vis_anomaly_detection(subset_2, 12, 1, 13, failures_67_subset1, line=False, training=False)
plt.show()
subset_5 = artifical_data.iloc[380000:425000,:]
failures_67_subset5 =[6539522., 6549554., 6572426., 6573162., 6574566., 6575118., 6575566., 6577254., 6582502., 6586022.]
vis_anomaly_detection(subset_5, 12, 1, 13, failures_67_subset5, line=True, training=False)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17156626506024097, 'fraction_numerical': 0.20433734939759035, 'mean_word_length': 6.923664122137405, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 22, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '554655', 'license': 'MIT', 'n_tokens_mistral': 1096, 'n_tokens_neox': 805, 'n_words': 134, 'path': 'src/visualisation/evaluation/MSE/evaluation_phm_data.ipynb', 'repo_name': 'carlov93/predictive_maintenance', 'size': '2075'}