feat(src): refactor file dir
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
from joblib import load
|
from joblib import load
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
from src.data_preprocessing import *
|
from data_preprocessing import *
|
||||||
from src.process_stft import compute_stft
|
from process_stft import compute_stft
|
||||||
from typing import List, Tuple
|
from typing import List, Tuple
|
||||||
from sklearn.base import BaseEstimator
|
from sklearn.base import BaseEstimator
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
def probability_damage(pred: Tuple[np.ndarray, np.ndarray], model_classes: BaseEstimator, percentage=False) -> Dict[str, int]:
|
def probability_damage(pred: Tuple[np.ndarray, np.ndarray], model_classes: BaseEstimator, percentage=False) -> Dict[str, int]:
|
||||||
"""
|
"""
|
||||||
Process the prediction output to return unique labels and their counts.
|
Process the prediction output to return unique labels and their counts.
|
||||||
@@ -132,16 +133,16 @@ def heatmap(result, damage_classes: list[int] = [1, 2, 3, 4, 5, 6]):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import json
|
import json
|
||||||
from scipy.interpolate import UnivariateSpline
|
# from scipy.interpolate import UnivariateSpline
|
||||||
|
|
||||||
|
|
||||||
result = inference(
|
result = inference(
|
||||||
"D:/thesis/models/Sensor A/SVM with StandardScaler and PCA.joblib",
|
"D:/thesis/models/Sensor A/SVM with StandardScaler and PCA.joblib",
|
||||||
"D:/thesis/models/Sensor B/SVM with StandardScaler and PCA.joblib",
|
"D:/thesis/models/Sensor B/SVM with StandardScaler and PCA.joblib",
|
||||||
"D:/thesis/data/dataset_B/zzzBD19.TXT"
|
"D:/thesis/data/dataset_B/zzzBU.TXT"
|
||||||
)
|
)
|
||||||
|
|
||||||
# heatmap(result)
|
heatmap(result)
|
||||||
# Convert all keys to strings before dumping to JSON
|
# Convert all keys to strings before dumping to JSON
|
||||||
# result_with_string_keys = convert_keys_to_strings(result)
|
# result_with_string_keys = convert_keys_to_strings(result)
|
||||||
# print(json.dumps(result_with_string_keys, indent=4))
|
# print(json.dumps(result_with_string_keys, indent=4))
|
||||||
Reference in New Issue
Block a user