# imperio
Imperio is a python sci-kit learn inspired package for feature engineering. It contains a some feature transformers to make your data more easy to learn from for Machine Learning Algorithms.
This version of imperio has the next methods of feature selection:
1. Box-Cox (BoxCoxTransformer).
2. Clusterize (ClusterizeTransformer).
3. Combinator (CombinatorTransformer).
4. Frequency Imputation Transformer (FrequencyImputationTransformer).
5. log Transformer (LogTransformer).
6. Smoothing (SmoothingTransformer).
7. Spatial-Sign Transformer (SpatialSignTransformer).
8. Target Imputation Transformer (TargetImputationTransformer).
9. Whitening (WhiteningTransformer).
10. Yeo-Johnson Transformer (YeoJohnsonTransformer).
11. ZCA (ZCATransformer).
All these methods work like normal sklearn transformers. They have fit, transform and fit_transform functions implemented.
Additionally every imperio transformer has an apply function which allows to apply an transformation on a pandas Data Frame.
# How to use imperio
To use a transformer from imperio you should just import the transformer from imperio in the following framework:
```python
from imperio import BoxCoxTransformer
```
class names are written above in parantheses.
Next create a object of this algorithm (Box-Cox is used as an example).
```python
method = BoxCoxTransformer()
```
Firstly you should fit the transformer, passing to it a feature matrix (X) and the target array (y).
NOTE: y argument is really used only by the Target-Imputation.
```python
method.fit(X, y)
```
After you fit the model, you can use it for transforming new data, using the transform function. To transform function you should pass only the feature matrix (X).
```python
X_transformed = method.transform(X)
```
Also you can fit and transform the data at the same time using the `fit_transform` function.
```python
X_transformed = method.fit_transform(X)
```
Also you can apply a transformation directly on a pandas DataFrame, choosing the columns that you want to change.
```python
new_df = method.apply(df, 'target', ['col1', 'col2']
```
Some advice:
1. Use `FrequencyImputationTransformer` or `TargetImputationTransformer` for categorical features.
2. Use `BoxCoxTransformer` or `YeoJohnsonTransformer` for numerical features to normalize a feature distribution.
3. Use `SpatialSignTransformer` on normalized data to bring outliers to normal samples.
4. Use `CombinatorTransformer` on tombine different transformers on categorical and numerical columns separately.
With <3 from Sigmoid!
We are open for feedback. Please send your impressions to vladimir.stojoc@gmail.com
Raw data
{
"_id": null,
"home_page": "https://github.com/SigmoidAI/imperio",
"name": "imperio",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "ml,machine learning,feature engineering,python,data science",
"author": "SigmoidAI - P\u0103p\u0103lu\u021b\u0103 Vasile, Stojoc Vladimir",
"author_email": "vladimir.stojoc@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/44/c7/c6222d0ed638e9ca0a111fe1d23fc2325c922dc8cd8b93acc98ab99ee12a/imperio-0.1.5.tar.gz",
"platform": null,
"description": "\n# imperio\n\nImperio is a python sci-kit learn inspired package for feature engineering. It contains a some feature transformers to make your data more easy to learn from for Machine Learning Algorithms.\n\nThis version of imperio has the next methods of feature selection:\n1. Box-Cox (BoxCoxTransformer).\n2. Clusterize (ClusterizeTransformer).\n3. Combinator (CombinatorTransformer).\n4. Frequency Imputation Transformer (FrequencyImputationTransformer).\n5. log Transformer (LogTransformer).\n6. Smoothing (SmoothingTransformer).\n7. Spatial-Sign Transformer (SpatialSignTransformer).\n8. Target Imputation Transformer (TargetImputationTransformer).\n9. Whitening (WhiteningTransformer).\n10. Yeo-Johnson Transformer (YeoJohnsonTransformer).\n11. ZCA (ZCATransformer).\n\nAll these methods work like normal sklearn transformers. They have fit, transform and fit_transform functions implemented.\n\nAdditionally every imperio transformer has an apply function which allows to apply an transformation on a pandas Data Frame.\n\n# How to use imperio\n\nTo use a transformer from imperio you should just import the transformer from imperio in the following framework:\n```python\nfrom imperio import BoxCoxTransformer\n```\n\nclass names are written above in parantheses.\n\nNext create a object of this algorithm (Box-Cox is used as an example).\n\n```python\nmethod = BoxCoxTransformer()\n```\n\nFirstly you should fit the transformer, passing to it a feature matrix (X) and the target array (y).\nNOTE: y argument is really used only by the Target-Imputation.\n\n```python\nmethod.fit(X, y)\n```\n\nAfter you fit the model, you can use it for transforming new data, using the transform function. To transform function you should pass only the feature matrix (X).\n\n```python\nX_transformed = method.transform(X)\n```\n\nAlso you can fit and transform the data at the same time using the `fit_transform` function.\n\n```python\nX_transformed = method.fit_transform(X)\n```\n\nAlso you can apply a transformation directly on a pandas DataFrame, choosing the columns that you want to change.\n\n```python\nnew_df = method.apply(df, 'target', ['col1', 'col2']\n```\n\nSome advice:\n1. Use `FrequencyImputationTransformer` or `TargetImputationTransformer` for categorical features.\n2. Use `BoxCoxTransformer` or `YeoJohnsonTransformer` for numerical features to normalize a feature distribution.\n3. Use `SpatialSignTransformer` on normalized data to bring outliers to normal samples.\n4. Use `CombinatorTransformer` on tombine different transformers on categorical and numerical columns separately.\n\nWith <3 from Sigmoid!\n\nWe are open for feedback. Please send your impressions to vladimir.stojoc@gmail.com\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Imperio is a python sci-kit learn inspired package for feature engineering.",
"version": "0.1.5",
"split_keywords": [
"ml",
"machine learning",
"feature engineering",
"python",
"data science"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e6527ead831c549633ab45574bde68d3da489aaf8ad253f53d462281b7c5e50d",
"md5": "53c003ab9289e4b4d5a003d6fbc0248b",
"sha256": "3377a04d1e826fd0356564c3a6afc2fe79e0655e4e269ea29ca61e77cea7ac55"
},
"downloads": -1,
"filename": "imperio-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "53c003ab9289e4b4d5a003d6fbc0248b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 24189,
"upload_time": "2023-02-05T15:13:19",
"upload_time_iso_8601": "2023-02-05T15:13:19.286665Z",
"url": "https://files.pythonhosted.org/packages/e6/52/7ead831c549633ab45574bde68d3da489aaf8ad253f53d462281b7c5e50d/imperio-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "44c7c6222d0ed638e9ca0a111fe1d23fc2325c922dc8cd8b93acc98ab99ee12a",
"md5": "7d6c5d92476e32610121f53a8ce5c25d",
"sha256": "93a0686de50e1a1ff3fe25be66c18c40fbac56f41e17cc044e7b7398ba67e683"
},
"downloads": -1,
"filename": "imperio-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "7d6c5d92476e32610121f53a8ce5c25d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12968,
"upload_time": "2023-02-05T15:13:21",
"upload_time_iso_8601": "2023-02-05T15:13:21.281275Z",
"url": "https://files.pythonhosted.org/packages/44/c7/c6222d0ed638e9ca0a111fe1d23fc2325c922dc8cd8b93acc98ab99ee12a/imperio-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-05 15:13:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "SigmoidAI",
"github_project": "imperio",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "imperio"
}