-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* start * fixed-colors * milestone * gogog * grid-search-fail * base-tests-work * added-sklego-test-dep * go-go-go * added-shapely-dep * bokeh-dep * added-guide * docs-ready * added-extra-test * fixed-final-test * outliers * added-outlier-func-tests * moar-testing * fix-test * added-3.8-test * added-3.9-test * lol-3.9-no-exist-yet * removed-deps-not-used * docs-updated * end-of-day * cleanup * added-preprocessor * docs-added * docs * more-docs-and-tests * this * added-label
- Loading branch information
Showing
17 changed files
with
1,110 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# `from hulearn.preprocessing import *` | ||
|
||
::: hulearn.preprocessing.pipetransformer | ||
|
||
::: hulearn.preprocessing.interactivepreprocessor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Sofar we've explored drawing as a tool for models, but it can also be used | ||
as a tool to generate features. To explore this, let's load in the penguins | ||
dataset again. | ||
|
||
```python | ||
from sklego.datasets import load_penguins | ||
|
||
df = load_penguins(as_frame=True).dropna() | ||
``` | ||
|
||
## Drawing | ||
|
||
We can draw over this dataset. It's like before but with one crucial differenc | ||
|
||
```python | ||
from hulearn.experimental.interactive import InteractiveCharts | ||
|
||
# Note that the `labels` arugment here is a list, not a string! This | ||
# tells the tool that we want to be able to add custom groups that are | ||
# not defined by a column in the dataframe. | ||
charts = InteractiveCharts(df, labels=['group_one', 'group_two']) | ||
``` | ||
|
||
Let's make a custom drawing. | ||
|
||
```python | ||
charts.add_chart(x="flipper_length_mm", y="body_mass_g") | ||
``` | ||
|
||
Let's assume the new drawing looks something like this. | ||
|
||
![](drawing.png) | ||
|
||
Sofar these drawn features have been used to construct models. But they | ||
can also be used to help label data or generate extra features for machine | ||
learning models. | ||
|
||
## Features | ||
|
||
This library makes it easy to add these features to scikit-learn | ||
pipelines or to pandas. To get started, you'll want to import the | ||
`InteractivePreprocessor`. | ||
|
||
```python | ||
from hulearn.preprocessing import InteractivePreprocessor | ||
tfm = InteractivePreprocessor(json_desc=charts.data()) | ||
``` | ||
|
||
This `tfm` object is can be used as a preprocessing step inside of | ||
scikit-learn but it can also be used in a pandas pipeline. | ||
|
||
```python | ||
# The flow for scikit-learn | ||
tfm.fit(df).transform(df) | ||
# The flow for pandas | ||
df.pipe(tfm.pandas_pipe) | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.