Package: scikit-ext
AboutThescikit_extpackage contains various scikit-learn extensions,
built entirely on top ofsklearnbase classes. The package is
separated into two modules:estimatorsandscorers.
Full documentation can be foundhere.InstallationPackage Index on PyPITo
install:pip install scikit-extEstimatorsMultiGridSearchCV: Extension to native sklearnGridSearchCVfor multiple estimators and param_grids. Accepts a list of
estimators and param_grids, iterating through each fitting aGridSearchCVmodel for each estimator/param_grid. Chooses the
best fittedGridSearchCVmodel. Inherits sklearn’sBaseSearchCVclass, so attributes and methods are all similar toGridSearchCV.PrunedPipeline: Extension to native sklearnPipelineintended
for text learning pipelines with a vectorization step and a feature
selection step. Instead of remembering all vectorizer vocabulary
elements and selecting appropriate features at prediction time, the
extension prunes the vocabulary after fitting to only include
elements who will ultimately survive the feature selection filter
applied later in the pipeline. This reduces memory and improves
prediction latency. Predictions will be identical to those made with
a trainedPipelinemodel. Inherits sklearn’sPipelineclass,
so attributes and methods are all similar toPipeline.ZoomGridSearchCV: Extension to native sklearnGridSearchCV.
Fits multipleGridSearchCVmodels, updating theparam_gridafter each iteration. The update looks at successful parameter values
for each grid key. A new list of values is created which expands the
resolution of the search values centered around the best performing
value of the previous fit. This allows the standard grid search
process to start with a small number of distant values for each
parameter, and zoom in as the better performing corner of the
hyperparameter search space becomes clear.IterRandomEstimator: Meta-Estimator intended primarily for
unsupervised estimators whose fitted model can be heavily dependent
on an arbitrary random initialization state. It is
best used for problems where afit_predictmethod is intended, so
the only data used for prediction will be the same data on which the
model was fitted.OptimizedEnsemble: An optimized ensemble class. Will find the
optimaln_estimatorsparameter for the given ensemble estimator,
according to the specified input parameters.OneVsRestAdjClassifier: One-Vs-Rest multiclass strategy. The
adjusted version is a custom extension which overwrites the inheritedpredict_probamethod with a more flexible method allowing custom
normalization for the predicted probabilities. Any norm argument that
can be passed directly tosklearn.preprocessing.normalizeis
allowed. Additionally, norm=None will skip the normalization step
alltogeter. To mimick the inheritedOneVsRestClassfierbehavior,
set norm=’l2’. All other methods are inherited fromOneVsRestClassifier.ScorersTimeScorer: Score using estimated prediction latency of
estimator.MemoryScorer: Score using estimated memory of pickled estimator
object.CombinedScorer: Score combining multiple scorers by averaging
their scores.cluster_distribution_score: Scoring function which scores the
resulting cluster distribution accross classes. A more even
distribution indicates a higher score.AuthorsEvan HarrisLicenseThis project is licensed under the MIT License - see the LICENSE file
for details