-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhk00570_main.py
More file actions
70 lines (43 loc) · 1.53 KB
/
hk00570_main.py
File metadata and controls
70 lines (43 loc) · 1.53 KB
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
import hk00570_functions as fct
import pandas as pd
import warnings
warnings.filterwarnings('ignore')
pd.set_option('display.max_columns', 999)
# GENRE
print('GENRE')
genre_class = fct.HKClassifierClass('genre')
# explore data set
genre_class.explore_data()
# pre-process data set
genre_class.pre_process_data()
# SOM classification
print('GENRE - SOM Classification')
# explore a variety of values for learning rate, sigma and neighborhood function
genre_class.explore_som_classification_parameters()
genre_class.execute_som_model(150, 5000, 15, 0.01, 'gaussian')
genre_class.som_10_fold_cross_validation(150, 5000)
# Decision Tree Classifier
print('GENRE - Decision Tree Classification')
tree = genre_class.execute_tree_model()
genre_class.explore_tree_pruning()
genre_class.tree_10_fold_cross_validation(tree)
genre_class.plot_ROC_curve()
## POPULARITY
print(' ')
print('POPULARITY')
poularity_class = fct.HKClassifierClass('popularity')
# explore data set
poularity_class.explore_data()
# pre-process data set
poularity_class.pre_process_data()
# SOM classification
print('POPULARITY - SOM Classification')
poularity_class.explore_som_classification_parameters()
poularity_class.execute_som_model(150, 5000, 5, 0.01, 'gaussian')
poularity_class.som_10_fold_cross_validation(150, 5000)
# Decision Tree Classifier
print('POPULARITY - Decision Tree Classification')
tree = poularity_class.execute_tree_model()
poularity_class.explore_tree_pruning()
poularity_class.tree_10_fold_cross_validation(tree)
poularity_class.plot_ROC_curve()