Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding credit scoring example for tabular dataset #117

Merged
merged 4 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions examples/tabular/scoring_prediction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# -*- coding: utf-8 -*-

"""scroing_prediction.ipynb



## Imports

"""

import pandas as pd
from fedot_ind import fedot_api
from sklearn.model_selection import train_test_split

"""## Opening Data"""

data = pd.read_csv('scoring_train.csv', index_col=0)
target = 'target'
X_train, X_test, y_train, y_test = train_test_split(data.drop(target, axis=1), data[target], test_size=0.3)

print('Shape of train', X_train.shape, 'and test', X_test.shape)

"""## Experiments settings"""

TIMEOUT = 15
N_JOBS = 1
EARLY_STOPPING_TIMEOUT = 45
METRIC = 'roc_auc'
TUNING = False

"""## Fedot (master)"""

automl = fedot_api.Fedot(
problem='classification',
timeout=TIMEOUT,
n_jobs=N_JOBS,
metric=METRIC,
with_tuning=TUNING,
early_stopping_timeout=EARLY_STOPPING_TIMEOUT,
show_progress=True
)

automl.fit(features=X_train, target=y_train)
automl.predict(features=X_test)
metric_after_1 = automl.get_metrics(target=y_test)
print(metric_after_1)
fedot_industrial_report = automl.return_report()
fedot_industrial_report.head(10)

"""## Fedot with use_auto_preprocessing (master)"""

automl = fedot_api.Fedot(
problem='classification',
timeout=TIMEOUT,
n_jobs=N_JOBS,
metric=METRIC,
with_tuning=TUNING,
early_stopping_timeout=EARLY_STOPPING_TIMEOUT,
show_progress=True

)

automl.fit(features=X_train, target=y_train)
automl.predict(features=X_test)
metric_after_2 = automl.get_metrics(target=y_test)
print(metric_after_2)
fedot_industrial_report = automl.return_report()
fedot_industrial_report.head(10)
print(automl.history.get_leaderboard())
Loading
Loading