shankarpandala / lazypredict

Lazy Predict help build a lot of basic models without much code and helps understand which models works better without any parameter tuning
MIT License
2.76k stars 317 forks source link

Boolean DataFrame incorrect shape #436

Open enricorox opened 8 months ago

enricorox commented 8 months ago

Describe the bug Passing boolean DataFrames gives Found array with 0 feature(s) and displays only the DummyClassifier. There are no warnings about the data type, only incorrect shape.

To Reproduce Execute the snippet

import numpy as np
import pandas as pd
from lazypredict.Supervised import LazyClassifier
from sklearn.model_selection import train_test_split

X = pd.DataFrame(np.random.choice([True, False], size=(10, 3)), columns=list('ABC'))
y = pd.DataFrame(np.random.choice([True, False], size=(10, 1)), columns=list('F'))

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.5, random_state=123)
clf = LazyClassifier(verbose=0, ignore_warnings=False, custom_metric=None)
models, predictions = clf.fit(X_train, X_test, y_train, y_test)
print(models)

Expected behavior Correctly handle boolean DataFrames

Desktop (please complete the following information):

Workaround https://stackoverflow.com/questions/77357871/lazypredict-found-array-with-0-features