-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
55 lines (42 loc) · 1.64 KB
/
main.c
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
#include "Header_Files/Headers.h"
#include "Header_Files/Defs.h"
#include "Header_Files/helping_procedures.h"
int main(int argc, char **argv)
{
if(argc < 3 || strtol(argv[1], NULL, 0) >= 4 || strtol(argv[1], NULL, 0) <= 0 ||
strtol(argv[2], NULL, 0) >= 4 || strtol(argv[2], NULL, 0) <= 0) {
print_execution_error_message();
return 1;
}
srand(time(NULL));
int data_set = (int) strtol(argv[2], NULL, 0);
char normalize_data = '\0';
if(! DEBUG) {
printf("Would you like to normalize the ");
if(data_set == 1) { printf("MNIST "); }
if(data_set == 2) { printf("BIO "); }
if(data_set == 3) { printf("HIGGS "); }
printf("data set?\nEnter 'y' or 'n': ");
scanf("%s", &normalize_data);
while(normalize_data != 'y' && normalize_data != 'n') {
printf("\nPlease enter 'y' or 'n' if you do or do not want to normalize the ");
if(data_set == 1) { printf("MNIST "); }
if(data_set == 2) { printf("BIO "); }
if(data_set == 3) { printf("HIGGS "); }
printf("data set: ");
scanf("%s", &normalize_data);
}
}
double *train_feature_data = NULL, *test_feature_data = NULL;
int *train_non_feature_data = NULL, *test_non_feature_data = NULL;
if(! DEBUG) {
fetch_datasets(data_set, &train_feature_data, &test_feature_data,
&train_non_feature_data, &test_non_feature_data);
}
int clustering_algorithm = (int) strtol(argv[1], NULL, 0);
cluster_and_search(clustering_algorithm, data_set,
normalize_data,
train_feature_data, test_feature_data,
train_non_feature_data, test_non_feature_data);
return 0;
}