RandomizedSearchCV/GridSearchCV with pandas.DataFrame interface
Project description
sklearn-cv-pandas
RandomizedSearchCV/GridSearchCV with pandas.DataFrame interface
Installation
pip install sklearn_cv_pandas
Usage
To tune hyper parameters, instantiate CV as the same as original ones, and use methods fit_sv_pandas
or fit_cv_pandas
from scipy import stats
from sklearn import linear_model
from sklearn_cv_pandas import RandomizedSearchCV
estimator = linear_model.Lasso()
param_dist = dict(alpha=stats.loguniform(1e-5, 10))
cv = RandomizedSearchCV(estimator, param_dist, scoring="mean_absolute_error")
model = cv.fit_cv_pandas(
df, target_column="y", feature_columns=["x{}".format(i) for i in range(100)], n_fold=5
)
To make prediction, use method predict
of the output of fit_sv_pandas
or fit_cv_pandas
model.predict(df)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for sklearn_cv_pandas-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2486eaadc68c8c5a779415cb7e8923ae010b2571e4b993ffe35ebc9f72486a8 |
|
MD5 | 4f9c7f2728135e1fa03d60b3b9639d71 |
|
BLAKE2b-256 | 765b70c73979beed0318c8efbf8707f6efa2c5895fa9ef752118aa3979517dcc |