generated from aaivu/aaivu-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
26 lines (25 loc) · 1.2 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Usage
from vrguard.feature_extractor.extract_1d_signal import FeatureExtractor_1D
import pandas as pd
from vrguard.classifiers.rf_classifier import rf_classifier
from vrguard.distortions.noise import distortions
import numpy as np
if __name__ == "__main__":
signals = pd.read_csv("C:\\Users\\USER\\Desktop\\Privacy_Re\\SAMPLES\\abalation_external\\raw_data\\ecg.csv", index_col=0)
signals=signals.iloc[0:5]
feature_extractor = FeatureExtractor_1D(fs=500, batch_size=100)
#extracted_features = feature_extractor.extract_features(signals)
#extracted_features=extracted_features.drop(columns=["PSD","R_peaks","P_peaks","Q_peaks","S_peaks","T_peaks"])
#extracted_features["label"]=[int(1) for i in range(0,extracted_features.shape[0])]
#rf=rf_classifier(random_state=42,n_estimators=100)
#y=extracted_features["label"]
#extracted_features=extracted_features.drop(columns=["label"])
#accuracy=rf.train_model(extracted_features,y,test_size=0.2)
new=distortions(signals)
new=new.horizontal_scaling(scale=0.5)
print(signals)
print("Scaled")
print(new)
# print(accuracy)
# print(extracted_features.head())
# # You can now work with the extracted_features DataFrame