sktools provides tools to extend sklearn, like several feature engineering based transformers.
To install sktools, run this command in your terminal:
$ pip install sktoolsCan be found in https://sktools.readthedocs.io
from sktools import IsEmptyExtractor
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
...
mod = Pipeline([
("impute-features", IsEmptyExtractor()),
("model", LogisticRegression())
])
...Here's a list of features that sktools currently offers:
sktools.encoders.NestedTargetEncoderperforms target encoding suited for variables with nesting.sktools.encoders.QuantileEncoderperforms target aggregation using a quantile instead of the mean.sktools.preprocessing.CyclicFeaturizerconverts numeric to cyclical features via sine and cosine transformations.sktools.impute.IsEmptyExtractorcreates binary variables indicating if there are missing values.sktools.matrix_denser.MatrixDensertransformer that converts sparse matrices to dense.sktools.quantilegroups.GroupedQuantileTransformercreates quantiles of a feature by group.sktools.quantilegroups.PercentileGroupFeaturizercreates features regarding how an instance compares with a quantile of its group.sktools.quantilegroups.MeanGroupFeaturizercreates features regarding how an instance compares with the mean of its group.sktools.selectors.TypeSelectorgets variables matching a type.sktools.selectors.ItemsSelectorallows to manually choose some variables.sktools.ensemble.MedianForestRegressorapplies the median instead of the mean when aggregating trees predictions.sktools.linear_model.QuantileRegressionsklearn style wrapper for quantile regression.sktools.model_selection.BootstrapFoldbootstrap cross-validator.sktools.GradientBoostingFeatureGeneratorAutomated feature generation through gradient boosting.
Fork/clone, in a fresh environment, run:
$ pip install -e ".[dev]"To check if the unit tests are ok, run
$ make testMIT license
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.