Skip to content

Commit

Permalink
Code review fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
nicl-nno committed Nov 16, 2023
1 parent 08c942d commit ffbf306
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions cases/credit_scoring/le_exp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from datetime import datetime

from sklearn.metrics import roc_auc_score as roc_auc
from sklearn.preprocessing import LabelEncoder
Expand Down Expand Up @@ -30,7 +31,6 @@ def run_problem(timeout: float = 5.0,
full_path_train = fedot_project_root().joinpath(file_path_train)

data = InputData.from_csv(full_path_train, task='classification', target_columns='class')

target = data.target
encoded = LabelEncoder().fit_transform(target)
data.target = encoded
Expand All @@ -43,10 +43,15 @@ def run_problem(timeout: float = 5.0,
metric='f1',
**composer_args)
if model_type != "auto":
start_time = datetime.now()
automl.fit(train, predefined_model=model_type)
end_time = datetime.now()
print(end_time - start_time)
print(train.features.shape)
else:
automl.fit(train)


automl.predict(test)
metrics = automl.get_metrics()

Expand All @@ -66,7 +71,7 @@ def run_problem(timeout: float = 5.0,
set_random_seed(42)

Consts.USE_LABEL_ENC_AS_DEFAULT = True

print('Labelenc')
run_problem(timeout=1,
visualization=False,
with_tuning=False, model_type='logit')
Expand All @@ -75,20 +80,22 @@ def run_problem(timeout: float = 5.0,
visualization=False,
with_tuning=False, model_type='xgboost')

run_problem(timeout=10,
visualization=True,
with_tuning=True, model_type='auto')
# run_problem(timeout=10,
# visualization=True,
# with_tuning=True, model_type='auto')

print('OH etc')

Consts.USE_LABEL_ENC_AS_DEFAULT = False

run_problem(timeout=1,
visualization=True,
visualization=False,
with_tuning=True, model_type='logit')

run_problem(timeout=1,
visualization=False,
with_tuning=False, model_type='xgboost')

run_problem(timeout=10,
visualization=True,
with_tuning=True, model_type='auto')
# run_problem(timeout=10,
# visualization=True,
# with_tuning=True, model_type='auto')

0 comments on commit ffbf306

Please sign in to comment.