Skip to main content

A collection of Scikit-learn-compatible transformers for feature engineering, preprocessing, and pipeline utilities.

Project description

Scikit-extensions

PyPI version Python Tests Coverage

A collection of Scikit-learn-compatible transformers for feature engineering, preprocessing, and pipeline utilities.

Installation

pip install scikit-extensions

Or with Poetry:

poetry add scikit-extensions

Features

1. StatsModelsOLS

A scikit-learn compatible wrapper for statsmodels OLS regression that provides additional statistical insights.

from skext.linear_model import OLSRegressor

# Create and fit model
model = OLSRegressor(fit_intercept=True)
model.fit(X, y)

# Get predictions
y_pred = model.predict(X_test)

# Access statsmodels summary
print(model.summary())

2. MulticollinearityRemover

Removes highly correlated features using various strategies.

from skext.multicolinerity import MulticollinearityRemover

# Initialize transformer
remover = MulticollinearityRemover(
    correlation_threshold=0.8,
    strategy='variance'  # Options: 'first', 'last', 'variance', 'missing_ratio', 'random'
)

# Fit and transform
X_transformed = remover.fit_transform(X)

# Get selected features
selected_features = remover.selected_features_

3. MultiLabelBinarizerTransformer

Transform multi-label columns in pandas DataFrames to binary indicator matrices.

from skext.multilabels import MultiLabelBinarizerTransformer

# Sample data
data = pd.DataFrame({
    'tags': [['python', 'ml'], ['python'], ['ml', 'deep-learning']],
    'categories': [['tech'], ['tech', 'tutorial'], ['tutorial']]
})

# Initialize and transform
mlb = MultiLabelBinarizerTransformer(sparse_output=False)
transformed = mlb.fit_transform(data)

Development

  1. Clone the repository:
git clone https://github.com/sh99/scikit-extensions.git
cd scikit-extensions
  1. Install dependencies:
poetry install

Running Tests

make test  # Run tests with coverage
make build  # Run tests and build package

License

MIT License. See LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests (make test)
  5. Submit a pull request

Requirements

  • Python ≥ 3.10
  • scikit-learn ≥ 1.7.2
  • pandas ≥ 2.3.2
  • statsmodels ≥ 0.14.5

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scikit_extensions-0.1.2.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scikit_extensions-0.1.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file scikit_extensions-0.1.2.tar.gz.

File metadata

  • Download URL: scikit_extensions-0.1.2.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.14.0-33-generic

File hashes

Hashes for scikit_extensions-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ab886b330fa00e43552903881e26020ca6b027d211efadaebea050e9f2936926
MD5 819e6536e3c9e13f5b05bbab372cc0a4
BLAKE2b-256 911ea8aaadc7b1dcd79110f5a7f85400ae86ed0e312ec760a547f7480cdcf6aa

See more details on using hashes here.

File details

Details for the file scikit_extensions-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: scikit_extensions-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.14.0-33-generic

File hashes

Hashes for scikit_extensions-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 834cbbd1725fd84aed389927e6932c20215ca1a23aa64cdc008dfc6b3b7601b7
MD5 dcc09524ae77dce2122e33252bde2c77
BLAKE2b-256 d4207da7161519767ef0a7e84e67493a2ca325162b099a5baa0477bafd9a0a9b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page