Package: sagemaker-scikit-learn-extension
SageMaker Scikit-Learn Extension is a Python module for machine learning built on top ofscikit-learn.This project contains standalone scikit-learn estimators and additional tools to support SageMaker Autopilot. Many of the additional estimators are based on existing scikit-learn estimators.User InstallationTo install,# install from pip
pip install sagemaker-scikit-learn-extensionIn order to use the I/O functionalies in thesagemaker_sklearn_extension.externalsmodule, you will also need to install themlioversion 0.7 package via conda. Themliopackage is only available through conda at the moment.To installmlio,# install mlio
conda install -c mlio -c conda-forge mlio-py==0.7To see more information about mlio, seehttps://github.com/awslabs/ml-io.You can also install from source by cloning this repository and running apip installcommand in the root directory of the repository:# install from source
git clone https://github.com/aws/sagemaker-scikit-learn-extension.git
cd sagemaker-scikit-learn-extension
pip install -e .Supported Operating SystemsSageMaker scikit-learn extension supports Unix/Linux and Mac.Supported Python VersionsSageMaker scikit-learn extension is tested on:Python 3.7LicenseThis library is licensed under the Apache 2.0 License.DevelopmentWe welcome contributions from developers of all experience levels.The SageMaker scikit-learn extension is meant to be a repository for scikit-learn estimators that don’t meet scikit-learn’s stringent inclusion criteria.SetupWe recommend using conda for development and testing.To download conda, go to theconda installation guide.Running TestsSageMaker scikit-learn extension contains an extensive suite of unit tests.You can install the libraries needed to run the tests by runningpip install --upgrade .[test]or, for Zsh users:pip install --upgrade .\[test\]For unit tests, tox will use pytest to run the unit tests in a Python 3.7 interpreter. tox will also run flake8 and pylint for style checks.conda is needed because of the dependency on mlio 0.7.To run the tests with tox, run:toxRunning on SageMakerTo use sagemaker-scikit-learn-extension on SageMaker, you can build thesagemaker-scikit-learn-extension-container.Overview of Submodulessagemaker_sklearn_extension.decompositionRobustPCAdimension reduction for dense and sparse inputssagemaker_sklearn_extension.externalsAutoMLTransformerutility class encapsulating feature and target transformation functionality used in SageMaker AutopilotHeaderutility class to manage the header and target columns in tabular dataread_csv_datareads comma separated data and returns a numpy array (uses mlio)sagemaker_sklearn_extension.feature_extraction.date_timeDateTimeVectorizerconvert datetime objects or strings into numeric featuressagemaker_sklearn_extension.feature_extraction.sequencesTSFlattenerconvert strings of sequences into numeric featuresTSFreshFeatureExtractorcompute row-wise time series features from a numpy array (uses tsfresh)sagemaker_sklearn_extension.feature_extraction.textMultiColumnTfidfVectorizerconvert collections of raw documents to a matrix of TF-IDF featuressagemaker_sklearn_extension.imputeRobustImputerimputer for missing values with customizable mask_function and multi-column constant imputationRobustMissingIndicatorbinary indicator for missing values with customizable mask_functionsagemaker_sklearn_extension.preprocessingBaseExtremeValuesTransformercustomizable transformer for columns that contain “extreme” values (columns that are heavy tailed)LogExtremeValuesTransformerstateful log transformer for columns that contain “extreme” values (columns that are heavy tailed)NALabelEncoderencoder for transforming labels to NA valuesQuadraticFeaturesgenerate and add quadratic features to feature matrixQuantileExtremeValuesTransformerstateful quantiles transformer for columns that contain “extreme” values (columns that are heThresholdOneHotEncoderencode categorical integer features as a one-hot numeric array, with optional restrictions on feature encodingRemoveConstantColumnsTransformerremoves constant columnsRobustLabelEncoderencode labels for seen and unseen labelsRobustStandardScalerstandardization for dense and sparse inputsWOEEncoderweight of evidence supervised encoderSimilarityEncoderencode categorical values based on their descriptive string