Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
C
covid_analysis
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
COMPARA
covid_analysis
Commits
37c5050e
Commit
37c5050e
authored
May 10, 2024
by
Joaquin Torres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.2. completed model definition
parent
17c2236c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
model_selection/output/hyperparam_post_ORIG_CS.xlsx
model_selection/output/hyperparam_post_ORIG_CS.xlsx
+0
-0
model_selection/test_models.py
model_selection/test_models.py
+7
-7
No files found.
model_selection/output/hyperparam_post_ORIG_CS.xlsx
View file @
37c5050e
No preview for this file type
model_selection/test_models.py
View file @
37c5050e
...
...
@@ -59,7 +59,7 @@ def get_tuned_models(group_id, method_id):
"RF"
:
RandomForestClassifier
(
**
{
'criterion'
:
'entropy'
,
'max_features'
:
'sqrt'
,
'n_estimators'
:
118
,
'class_weight'
:
'balanced'
}),
"Bagging"
:
BaggingClassifier
(
**
{
'max_features'
:
1.0
,
'max_samples'
:
1.0
,
'n_estimators'
:
15
,
'warm_start'
:
False
,
'estimator'
:
DecisionTreeClassifier
(
class_weight
=
'balanced'
)}),
"AB"
:
AdaBoostClassifier
(
**
{
'learning_rate'
:
0.8159074545140872
,
'n_estimators'
:
121
,
'algorithm'
:
'SAMME'
,
'estimator'
:
DecisionTreeClassifier
(
class_weight
=
'balanced'
)}),
"LR"
:
LogisticRegression
(
**
{
'solver'
:
'lbfgs'
,
'penalty'
:
'none'
,
'max_iter'
:
1000
,
'class_weight'
:
'balanced'
}),
"LR"
:
LogisticRegression
(
**
{
'solver'
:
'lbfgs'
,
'penalty'
:
None
,
'max_iter'
:
1000
,
'class_weight'
:
'balanced'
}),
"SVM"
:
SVC
(
**
{
'C'
:
1.5550524351360953
,
'kernel'
:
'linear'
,
'max_iter'
:
1000
,
'class_weight'
:
'balanced'
}),
}
# 1.3) Trained with oversampled training dataset
...
...
@@ -103,12 +103,12 @@ def get_tuned_models(group_id, method_id):
# 2.2) Trained with original dataset and cost-sensitive learning
elif
method_id
==
1
:
tuned_models
=
{
# "DT": DecisionTreeClassifier(**{'splitter': 'best', 'max_features': 'log2', 'criterion': 'entropy
', 'class_weight': 'balanced'}),
# "RF": RandomForestClassifier(**{'criterion': 'entropy', 'max_features': 'sqrt', 'n_estimators': 118
, 'class_weight': 'balanced'}),
# "Bagging": BaggingClassifier(**{'max_features': 1.0, 'max_samples': 1.0, 'n_estimators': 15, 'warm_start': Fals
e, 'estimator': DecisionTreeClassifier(class_weight='balanced')}),
# "AB": AdaBoostClassifier(**{'learning_rate': 0.8159074545140872, 'n_estimators': 121
, 'algorithm': 'SAMME', 'estimator': DecisionTreeClassifier(class_weight='balanced')}),
# "LR": LogisticRegression(**{'solver': 'lbfgs', 'penalty': 'none'
, 'max_iter': 1000, 'class_weight': 'balanced'}),
# "SVM": SVC(**{'C': 1.5550524351360953, 'kernel': 'linear', 'max_iter': 1000, 'class_weight': 'balanced'}),
"DT"
:
DecisionTreeClassifier
(
**
{
'splitter'
:
'best'
,
'max_features'
:
'sqrt'
,
'criterion'
:
'log_loss
'
,
'class_weight'
:
'balanced'
}),
"RF"
:
RandomForestClassifier
(
**
{
'criterion'
:
'entropy'
,
'max_features'
:
'sqrt'
,
'n_estimators'
:
164
,
'class_weight'
:
'balanced'
}),
"Bagging"
:
BaggingClassifier
(
**
{
'max_features'
:
1.0
,
'max_samples'
:
0.8
,
'n_estimators'
:
11
,
'warm_start'
:
Tru
e
,
'estimator'
:
DecisionTreeClassifier
(
class_weight
=
'balanced'
)}),
"AB"
:
AdaBoostClassifier
(
**
{
'learning_rate'
:
1.7102248217141944
,
'n_estimators'
:
108
,
'algorithm'
:
'SAMME'
,
'estimator'
:
DecisionTreeClassifier
(
class_weight
=
'balanced'
)}),
"LR"
:
LogisticRegression
(
**
{
'solver'
:
'lbfgs'
,
'penalty'
:
None
,
'max_iter'
:
1000
,
'class_weight'
:
'balanced'
}),
"SVM"
:
SVC
(
**
{
'C'
:
1.1313840454519628
,
'kernel'
:
'sigmoid'
,
'max_iter'
:
1000
,
'class_weight'
:
'balanced'
})
}
# 2.3) Trained with oversampled training dataset
elif
method_id
==
2
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment