Skip to content

Commit

Permalink
refactor: rename the ibisml package to ibis_ml
Browse files Browse the repository at this point in the history
  • Loading branch information
deepyaman committed May 7, 2024
1 parent 5f94f4e commit ea531df
Show file tree
Hide file tree
Showing 27 changed files with 104 additions and 104 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ IbisML is a library for building scalable ML pipelines using Ibis:

- Preprocess your data at scale on any [Ibis](https://ibis-project.org/)-supported
backend.
- Compose [`Recipe`](/reference/core.html#ibisml.Recipe)s with other scikit-learn
- Compose [`Recipe`](/reference/core.html#ibis_ml.Recipe)s with other scikit-learn
estimators using
[`Pipeline`](https://scikit-learn.org/stable/modules/compose.html#pipeline-chaining-estimators)s.
- Seamlessly integrate with [scikit-learn](https://scikit-learn.org/stable/),
Expand All @@ -20,7 +20,7 @@ IbisML is a library for building scalable ML pipelines using Ibis:

```python
import ibis
import ibisml as ml
import ibis_ml as ml

# A recipe for a feature engineering pipeline that:
# - imputes missing values in numeric columns with their mean
Expand Down
6 changes: 3 additions & 3 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ format:
css: styles.css

quartodoc:
package: ibisml
package: ibis_ml
title: Reference
sidebar: reference/_sidebar.yml
dynamic: true
Expand All @@ -98,7 +98,7 @@ quartodoc:
signature_name: short
sections:
- title: Core
package: ibisml
package: ibis_ml
contents:
- kind: page
path: core
Expand Down Expand Up @@ -136,7 +136,7 @@ quartodoc:

- title: Steps
desc: Define steps in a recipe
package: ibisml
package: ibis_ml
contents:
- kind: page
path: steps-imputation
Expand Down
6 changes: 3 additions & 3 deletions docs/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hide-description: true

- Preprocess your data at scale on any [Ibis](https://ibis-project.org/)-supported
backend.
- Compose [`Recipe`](/reference/core.html#ibisml.Recipe)s with other scikit-learn
- Compose [`Recipe`](/reference/core.html#ibis_ml.Recipe)s with other scikit-learn
estimators using
[`Pipeline`](https://scikit-learn.org/stable/modules/compose.html#pipeline-chaining-estimators)s.
- Seamlessly integrate with [scikit-learn](https://scikit-learn.org/stable/),
Expand All @@ -23,7 +23,7 @@ hide-description: true
### Install IbisML

```bash
pip install ibisml
pip install ibis-ml
```

### Create your first recipe
Expand All @@ -34,7 +34,7 @@ mean of each numeric column and then normalize numeric data to have a standard d
of one and a mean of zero.

```{python}
import ibisml as ml
import ibis_ml as ml
imputer = ml.ImputeMean(ml.numeric())
scaler = ml.ScaleStandard(ml.numeric())
Expand Down
10 changes: 5 additions & 5 deletions docs/tutorial/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
"metadata": {},
"outputs": [],
"source": [
"import ibisml as ml\n",
"import ibis_ml as ml\n",
"\n",
"flights_rec = ml.Recipe(\n",
" ml.ExpandDate(\"date\", components=[\"dow\", \"month\"]),\n",
Expand Down Expand Up @@ -1095,7 +1095,7 @@
" /* fitted */\n",
" background-color: var(--sklearn-color-fitted-level-3);\n",
"}\n",
"</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>Pipeline(steps=[(&#x27;flights_rec&#x27;, &lt;ibisml.core.Recipe object at 0x149360730&gt;),\n",
"</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>Pipeline(steps=[(&#x27;flights_rec&#x27;, &lt;ibis_ml.core.Recipe object at 0x149360730&gt;),\n",
" (&#x27;mod&#x27;,\n",
" &lt;class &#x27;skorch.classifier.NeuralNetClassifier&#x27;&gt;[initialized](\n",
" module_=MyModule(\n",
Expand All @@ -1106,7 +1106,7 @@
" (output): Linear(in_features=10, out_features=2, bias=True)\n",
" (softmax): Softmax(dim=-1)\n",
" ),\n",
"))])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" ><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\">&nbsp;&nbsp;Pipeline<a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.4/modules/generated/sklearn.pipeline.Pipeline.html\">?<span>Documentation for Pipeline</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></label><div class=\"sk-toggleable__content fitted\"><pre>Pipeline(steps=[(&#x27;flights_rec&#x27;, &lt;ibisml.core.Recipe object at 0x149360730&gt;),\n",
"))])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" ><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\">&nbsp;&nbsp;Pipeline<a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.4/modules/generated/sklearn.pipeline.Pipeline.html\">?<span>Documentation for Pipeline</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></label><div class=\"sk-toggleable__content fitted\"><pre>Pipeline(steps=[(&#x27;flights_rec&#x27;, &lt;ibis_ml.core.Recipe object at 0x149360730&gt;),\n",
" (&#x27;mod&#x27;,\n",
" &lt;class &#x27;skorch.classifier.NeuralNetClassifier&#x27;&gt;[initialized](\n",
" module_=MyModule(\n",
Expand All @@ -1117,7 +1117,7 @@
" (output): Linear(in_features=10, out_features=2, bias=True)\n",
" (softmax): Softmax(dim=-1)\n",
" ),\n",
"))])</pre></div> </div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-2\" type=\"checkbox\" ><label for=\"sk-estimator-id-2\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\">Recipe</label><div class=\"sk-toggleable__content fitted\"><pre>&lt;ibisml.core.Recipe object at 0x149360730&gt;</pre></div> </div></div><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-3\" type=\"checkbox\" ><label for=\"sk-estimator-id-3\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\">NeuralNetClassifier</label><div class=\"sk-toggleable__content fitted\"><pre>&lt;class &#x27;skorch.classifier.NeuralNetClassifier&#x27;&gt;[initialized](\n",
"))])</pre></div> </div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-2\" type=\"checkbox\" ><label for=\"sk-estimator-id-2\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\">Recipe</label><div class=\"sk-toggleable__content fitted\"><pre>&lt;ibis_ml.core.Recipe object at 0x149360730&gt;</pre></div> </div></div><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-3\" type=\"checkbox\" ><label for=\"sk-estimator-id-3\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\">NeuralNetClassifier</label><div class=\"sk-toggleable__content fitted\"><pre>&lt;class &#x27;skorch.classifier.NeuralNetClassifier&#x27;&gt;[initialized](\n",
" module_=MyModule(\n",
" (dense0): Linear(in_features=10, out_features=10, bias=True)\n",
" (nonlin): ReLU()\n",
Expand All @@ -1129,7 +1129,7 @@
")</pre></div> </div></div></div></div></div></div>"
],
"text/plain": [
"Pipeline(steps=[('flights_rec', <ibisml.core.Recipe object at 0x149360730>),\n",
"Pipeline(steps=[('flights_rec', <ibis_ml.core.Recipe object at 0x149360730>),\n",
" ('mod',\n",
" <class 'skorch.classifier.NeuralNetClassifier'>[initialized](\n",
" module_=MyModule(\n",
Expand Down
6 changes: 3 additions & 3 deletions ibisml/__init__.py → ibis_ml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""IbisML is a library for building scalable ML pipelines using Ibis."""

from ibisml.core import Recipe, Step
from ibisml.select import (
from ibis_ml.core import Recipe, Step
from ibis_ml.select import (
categorical,
cols,
contains,
Expand All @@ -22,7 +22,7 @@
timestamp,
where,
)
from ibisml.steps import *
from ibis_ml.steps import *

from ._version import __version__

Expand Down
2 changes: 1 addition & 1 deletion ibisml/_version.py → ibis_ml/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from importlib.metadata import version

__version__ = version("ibisml")
__version__ = version("ibis_ml")
2 changes: 1 addition & 1 deletion ibisml/core.py → ibis_ml/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def _get_categorize_chunk() -> Callable[[str, list[str], Any], pd.DataFrame]:
"""Wrap the `categorize` function in a closure, so cloudpickle will encode
the full function.
This avoids requiring `ibisml` or `ibis` exist on the worker nodes of the
This avoids requiring `ibis_ml` or `ibis` exist on the worker nodes of the
dask cluster.
"""

Expand Down
2 changes: 1 addition & 1 deletion ibisml/select.py → ibis_ml/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import ibis.expr.types as ir

if TYPE_CHECKING:
from ibisml.core import Metadata
from ibis_ml.core import Metadata


class Selector:
Expand Down
36 changes: 36 additions & 0 deletions ibis_ml/steps/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from ibis_ml.steps.common import Cast, Drop, Mutate, MutateAt
from ibis_ml.steps.discretize import DiscretizeKBins
from ibis_ml.steps.encode import (
CategoricalEncode,
CountEncode,
OneHotEncode,
TargetEncode,
)
from ibis_ml.steps.feature_engineering import PolynomialFeatures
from ibis_ml.steps.feature_selection import ZeroVariance
from ibis_ml.steps.impute import FillNA, ImputeMean, ImputeMedian, ImputeMode
from ibis_ml.steps.standardize import ScaleMinMax, ScaleStandard
from ibis_ml.steps.temporal import ExpandDate, ExpandDateTime, ExpandTime

__all__ = (
"Cast",
"CategoricalEncode",
"CountEncode",
"DiscretizeKBins",
"Drop",
"ExpandDate",
"ExpandDateTime",
"ExpandTime",
"FillNA",
"ImputeMean",
"ImputeMedian",
"ImputeMode",
"Mutate",
"MutateAt",
"OneHotEncode",
"PolynomialFeatures",
"ScaleMinMax",
"ScaleStandard",
"TargetEncode",
"ZeroVariance",
)
12 changes: 6 additions & 6 deletions ibisml/steps/common.py → ibis_ml/steps/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import ibis.expr.types as ir
from ibis.common.deferred import Deferred

from ibisml.core import Metadata, Step
from ibisml.select import SelectionType, selector
from ibis_ml.core import Metadata, Step
from ibis_ml.select import SelectionType, selector


class Drop(Step):
Expand All @@ -20,7 +20,7 @@ class Drop(Step):
Examples
--------
>>> import ibisml as ml
>>> import ibis_ml as ml
Drop all non-numeric columns
Expand Down Expand Up @@ -59,7 +59,7 @@ class Cast(Step):
Examples
--------
>>> import ibisml as ml
>>> import ibis_ml as ml
Cast all numeric columns to float64
Expand Down Expand Up @@ -107,7 +107,7 @@ class MutateAt(Step):
Examples
--------
>>> import ibisml as ml
>>> import ibis_ml as ml
>>> from ibis import _
Replace all numeric columns with their absolute values.
Expand Down Expand Up @@ -170,7 +170,7 @@ class Mutate(Step):
Examples
--------
>>> import ibisml as ml
>>> import ibis_ml as ml
>>> from ibis import _
Define a new column ``c`` as ``a**2 + b**2``
Expand Down
8 changes: 4 additions & 4 deletions ibisml/steps/discretize.py → ibis_ml/steps/discretize.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import ibis.expr.types as ir
import numpy as np

from ibisml.core import Metadata, Step
from ibisml.select import SelectionType, selector
from ibis_ml.core import Metadata, Step
from ibis_ml.select import SelectionType, selector


class DiscretizeKBins(Step):
Expand All @@ -34,8 +34,8 @@ class DiscretizeKBins(Step):
Examples
--------
>>> import ibis
>>> import ibisml as ml
>>> from ibisml.core import Metadata
>>> import ibis_ml as ml
>>> from ibis_ml.core import Metadata
>>> ibis.options.interactive = True
Load penguins dataset
Expand Down
14 changes: 7 additions & 7 deletions ibisml/steps/encode.py → ibis_ml/steps/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import ibis
import ibis.expr.types as ir

from ibisml.core import Metadata, Step
from ibisml.select import SelectionType, selector
from ibisml.steps.impute import FillNA
from ibis_ml.core import Metadata, Step
from ibis_ml.select import SelectionType, selector
from ibis_ml.steps.impute import FillNA


def _compute_categories(
Expand Down Expand Up @@ -94,7 +94,7 @@ class OneHotEncode(Step):
Examples
--------
>>> import ibisml as ml
>>> import ibis_ml as ml
One-hot encode all string columns.
Expand Down Expand Up @@ -183,7 +183,7 @@ class CategoricalEncode(Step):
Examples
--------
>>> import ibisml as ml
>>> import ibis_ml as ml
Categorical encode all string columns.
Expand Down Expand Up @@ -261,7 +261,7 @@ class CountEncode(Step):
Examples
--------
>>> import ibisml as ml
>>> import ibis_ml as ml
Count encode all string columns.
Expand Down Expand Up @@ -309,7 +309,7 @@ class TargetEncode(Step):
Examples
--------
>>> import ibisml as ml
>>> import ibis_ml as ml
Target encode all string columns.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import ibis.expr.types as ir

from ibisml.core import Metadata, Step
from ibisml.select import SelectionType, selector
from ibis_ml.core import Metadata, Step
from ibis_ml.select import SelectionType, selector


class PolynomialFeatures(Step):
Expand All @@ -25,7 +25,7 @@ class PolynomialFeatures(Step):
Examples
--------
>>> import ibisml as ml
>>> import ibis_ml as ml
Generate polynomial features for all numeric columns with a degree is 2.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import ibis.expr.types as ir

from ibisml.core import Metadata, Step
from ibisml.select import SelectionType, selector
from ibis_ml.core import Metadata, Step
from ibis_ml.select import SelectionType, selector


class ZeroVariance(Step):
Expand All @@ -22,7 +22,7 @@ class ZeroVariance(Step):
Examples
--------
>>> import ibisml as ml
>>> import ibis_ml as ml
To remove columns with zero variance:
>>> step = ml.ZeroVariance(ml.everything())
Expand Down
Loading

0 comments on commit ea531df

Please sign in to comment.