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.78k stars 321 forks source link

Questions regarding Examples #386

Open BradKML opened 1 year ago

BradKML commented 1 year ago

Description

Why does the current example not use a splitter function, instead relying on hard-coding? Bonus Question: Are K-Fold and ShuffleSplit good ideas for increasing cross-testing?

Ref (documentation): https://lazypredict.readthedocs.io/en/latest/usage.html#regression Ref (function): https://scikit-learn.org/stable/modules/classes.html#splitter-functions

BradKML commented 1 year ago

Sample Draft:

from pandas import read_csv
from lazypredict.Supervised import LazyRegressor
from sklearn.model_selection import train_test_split
import numpy as np
df = read_csv('data_example.csv').dropna()
X, y = df.drop(['output'], axis=1).astype(np.float32), df['output'].astype(np.float32)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.1, random_state=13)
reg = LazyRegressor(verbose=0,ignore_warnings=False, custom_metric=None)
models,predictions = reg.fit(X_train, X_test, y_train, y_test)