EpistasisLab / EpistasisLab/tpot

Question - Why class imbalance parameters are not considered during optimization?

Open
#1,213 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
10.1k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

I have a highly skewed dataset. I was hoping that Tpot will make use of parameters like `class_weight` (in logistic regression) and `scale_pos_weight` (Xgboost) but it doesn't recognize the class distribution

[Am I missing anything here? I tried with 90:10 ratio dataset and was expecting that `TPOT` will automatically recognize my class distribution and identify a parameter suitable to capture the class distribution. May I check on why doesn't TPOT do that? ]

For example, the below was the pipeline returned by TPOT for a heavily imbalanced dataset. You can see that it didn't consider `class_weight` parameter and set it to `balanced`.

```
tpot_data = pd.read_csv('PATH/TO/DATA/FILE', sep='COLUMN_SEPARATOR', dtype=np.float64)
features = tpot_data.drop('target', axis=1)
training_features, testing_features, training_target, testing_target = \
train_test_split(features, tpot_data['target'], random_state=None)

# Average CV score on the training set was: 0.40668814943177767
exported_pipeline = LogisticRegression()

exported_pipeline.fit(training_features, training_target)
results = exported_pipeline.predict(testing_features)

```
You can see in the screenshot below that for Xgboost classifier it hasn't consider the `scale_pos_weight` parameter. I would have expected to see TPOT use that. can help me understand why doesn't TPOT use that parameter?

![image](https://user-images.githubusercontent.com/61312399/120802434-fefffe80-c574-11eb-91eb-6f14a859c62b.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.