🛠 scikit-mtr: Multi-Task Regression in Python
scikit-mtr provides a framework for multi-task regression using popular regression algorithms and introduces a
stacking method to combine different regressors for enhanced performance.
🌟 Features
- 📊 Support for multiple regressors: Decision Trees, Linear Regression, Random Forests, Extra Trees, MLP, and MOKP.
- 🏆 Stacking method to combine predictions from various regressors.
📦 Installation
pip install scikit-mtr
⚡ Quick Start
Get up and running with scikit-mtr in a flash:
from sklearn.model_selection import train_test_split
from scikit_mtr.multi_output_tools import multi_output_regressor, load_data_by_sklearn
params = {
'regressor': 'LR',
'dataset': 41467,
'random_seed': 0
}
# Load and split data
X, y = load_data_by_sklearn(params['dataset'])
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=params['random_seed'])
# Initialize regressor
model = multi_output_regressor(params['regressor'])
model.fit(X_train, y_train)
# 🎯 Make predictions
y_pred_test = model.predict(X_test)
📚 Using Stacking
scikit-mtr introduces a powerful stacking method where base regressors' predictions serve as features for
meta-regressors:
from scikit_mtr.multi_output_stacking import MultiTargetRegressorStacking
base_regressors = [LinearRegression() for _ in range(y_train.shape[1])]
meta_regressors = [LinearRegression() for _ in range(y_train.shape[1])]
stacker = MultiTargetRegressorStacking(base_regressors, meta_regressors)
stacker.fit(X_train, y_train)
stacked_predictions = stacker.predict(X_test)
print(stacked_predictions)
🧪 Supported Regressors
Currently, the following regressors are in our arsenal:
DT: 🌲 Decision TreeLR: 📈 Linear RegressionRF: 🌳 Random ForestET: 🍃 Extra TreesMLP: 🧠 Multi-layer PerceptronMOKP: 🔮 MOKP Regressor
Metadata
Release files for scikit-MTR 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scikit-MTR-0.1.0.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scikit_MTR-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / scikit-MTR-0.1.0.tar.gz
| Download URL | scikit-MTR-0.1.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff3b4e9a624c5a289e85af761beeeeb82b2db6f17a1efb2027eb790e68249cdd
|
|
BLAKE2b-256 checksum How to use checksums |
a14da7c6666ac55013999681e5d3e469d779aa0656c0fbbc15abfc7e278ebd62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / scikit_MTR-0.1.0-py3-none-any.whl
| Download URL | scikit_MTR-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
daf2d0f0472bfef80bee38fff06268204739efd3c312d28dd9d101d46ca78707
|
|
BLAKE2b-256 checksum How to use checksums |
6225c22c5d0ae89e4e0545fb196b3e52c49f6730f7431ff8d47b9adac263e4f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|