-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclassical_classification.py
164 lines (156 loc) · 4.08 KB
/
classical_classification.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
from aeon.datasets._data_loaders import load_classification
from tsml_eval.estimators.classification.convolution_based import HYDRA, MultiRocketHydra
from aeon.classification.convolution_based._rocket_classifier import RocketClassifier
from tsml_eval.experiments import run_classification_experiment
from tsml_eval.evaluation.storage import load_classifier_results
# from aeon.datasets.tsc_data_lists import univariate_equal_length as dataset_list
# This is the univariate_equal_length of the import above
dataset_list = [
"ACSF1",
"Adiac",
"ArrowHead",
"Beef",
"BeetleFly",
"BirdChicken",
"BME",
"Car",
"CBF",
"Chinatown",
"ChlorineConcentration",
"CinCECGTorso",
"Coffee",
"Computers",
"CricketX",
"CricketY",
"CricketZ",
"Crop",
"DiatomSizeReduction",
"DistalPhalanxOutlineCorrect",
"DistalPhalanxOutlineAgeGroup",
"DistalPhalanxTW",
"Earthquakes",
"ECG200",
"ECG5000",
"ECGFiveDays",
"ElectricDevices",
"EOGHorizontalSignal",
"EOGVerticalSignal",
"EthanolLevel",
"FaceAll",
"FaceFour",
"FacesUCR",
"FiftyWords",
"Fish",
"FordA",
"FordB",
"FreezerRegularTrain",
"FreezerSmallTrain",
"GunPoint",
"GunPointAgeSpan",
"GunPointMaleVersusFemale",
"GunPointOldVersusYoung",
"Ham",
"HandOutlines",
"Haptics",
"Herring",
"HouseTwenty",
"InlineSkate",
"InsectEPGRegularTrain",
"InsectEPGSmallTrain",
"InsectWingbeatSound",
"ItalyPowerDemand",
"LargeKitchenAppliances",
"Lightning2",
"Lightning7",
"Mallat",
"Meat",
"MedicalImages",
"MiddlePhalanxOutlineCorrect",
"MiddlePhalanxOutlineAgeGroup",
"MiddlePhalanxTW",
"MixedShapesRegularTrain",
"MixedShapesSmallTrain",
"MoteStrain",
"NonInvasiveFetalECGThorax1",
"NonInvasiveFetalECGThorax2",
"OliveOil",
"OSULeaf",
"PhalangesOutlinesCorrect",
"Phoneme",
"PigAirwayPressure",
"PigArtPressure",
"PigCVP",
"Plane",
"PowerCons",
"ProximalPhalanxOutlineCorrect",
"ProximalPhalanxOutlineAgeGroup",
"ProximalPhalanxTW",
"RefrigerationDevices",
"Rock",
"ScreenType",
"SemgHandGenderCh2",
"SemgHandMovementCh2",
"SemgHandSubjectCh2",
"ShapeletSim",
"ShapesAll",
"SmallKitchenAppliances",
"SmoothSubspace",
"SonyAIBORobotSurface1",
"SonyAIBORobotSurface2",
"StarLightCurves",
"Strawberry",
"SwedishLeaf",
"Symbols",
"SyntheticControl",
"ToeSegmentation1",
"ToeSegmentation2",
"Trace",
"TwoLeadECG",
"TwoPatterns",
"UMD",
"UWaveGestureLibraryAll",
"UWaveGestureLibraryX",
"UWaveGestureLibraryY",
"UWaveGestureLibraryZ",
"Wafer",
"Wine",
"WordSynonyms",
"Worms",
"WormsTwoClass",
"Yoga",
]
# Estimators/Models
estimator = {
'HYDRA': HYDRA(k=9),
'Multi-R': RocketClassifier(rocket_transform='MultiRocket'),
'Hydra-MR': MultiRocketHydra(),
'RocketClassifier': RocketClassifier(rocket_transform='Rocket'),
}
# Parameters
NUM_EXPERIMENTS = 1
for dataset_name in dataset_list:
X_train, y_train = load_classification(dataset_name, split='train')
X_test, y_test = load_classification(dataset_name, split='test')
# print(dataset_name)
for current_model in estimator:
for experiment in range(NUM_EXPERIMENTS):
# print('****', current_model, '****')
run_classification_experiment(
X_train,
y_train,
X_test,
y_test,
classifier = estimator[current_model],
results_path = "./experiments/",
dataset_name=dataset_name,
resample_id=0,
)
# # # RESULTS
# cr = load_classifier_results(
# "./experiments/HYDRA/Predictions/ACSF1/testResample0.csv"
# )
# print(cr.predictions)
# print(cr.accuracy)
# print(cr.balanced_accuracy)
# print(cr.auroc_score)
# print(cr.log_loss)