a data typing library for machine learning
Project description
Woodwork provides a common typing namespace for using your existing DataFrames in Featuretools, EvalML, and general ML. A Woodwork DataFrame stores the physical, logical, and semantic data types present in the data. In addition, it can store metadata about the data, allowing you to store specific information you might need for your application.
Installation
Install with pip:
python -m pip install woodwork
or from the conda-forge channel on conda:
conda install -c conda-forge woodwork
Add-ons
Update checker - Receive automatic notifications of new Woodwork releases
python -m pip install "woodwork[updater]"
Example
Below is an example of using Woodwork. In this example, a sample dataset of order items is used to create a Woodwork DataFrame
, specifying the LogicalType
for five of the columns.
import pandas as pd
import woodwork as ww
df = pd.read_csv("https://oss.alteryx.com/datasets/online-retail-logs-2018-08-28.csv")
df.ww.init(name='retail')
df.ww.set_types(logical_types={
'quantity': 'Integer',
'customer_name': 'PersonFullName',
'country': 'Categorical',
'order_id': 'Categorical',
'description': 'NaturalLanguage',
})
df.ww
Physical Type Logical Type Semantic Tag(s)
Column
order_id category Categorical ['category']
product_id category Categorical ['category']
description string NaturalLanguage []
quantity int64 Integer ['numeric']
order_date datetime64[ns] Datetime []
unit_price float64 Double ['numeric']
customer_name string PersonFullName []
country category Categorical ['category']
total float64 Double ['numeric']
cancelled bool Boolean []
We now have initialized Woodwork on the DataFrame with the specified logical types assigned. For columns that did not have a specified logical type value, Woodwork has automatically inferred the logical type based on the underlying data. Additionally, Woodwork has automatically assigned semantic tags to some of the columns, based on the inferred or assigned logical type.
If we wanted to do further analysis on only the columns in this table that have a logical type of Boolean
or a semantic tag of numeric
we can simply select those columns and access a dataframe containing just those columns:
filtered_df = df.ww.select(include=['Boolean', 'numeric'])
filtered_df
quantity unit_price total cancelled
0 6 4.2075 25.245 False
1 6 5.5935 33.561 False
2 8 4.5375 36.300 False
3 6 5.5935 33.561 False
4 6 5.5935 33.561 False
.. ... ... ... ...
95 6 4.2075 25.245 False
96 120 0.6930 83.160 False
97 24 0.9075 21.780 False
98 24 0.9075 21.780 False
99 24 0.9075 21.780 False
As you can see, Woodwork makes it easy to manage typing information for your data, and provides simple interfaces to access only the data you need based on the logical types or semantic tags. Please refer to the Woodwork documentation for more detail on working with a Woodwork DataFrame.
Support
The Woodwork community is happy to provide support to users of Woodwork. Project support can be found in four places depending on the type of question:
- For usage questions, use Stack Overflow with the
woodwork
tag. - For bugs, issues, or feature requests start a Github issue.
- For discussion regarding development on the core library, use Slack.
- For everything else, the core developers can be reached by email at open_source_support@alteryx.com
Built at Alteryx
Woodwork is an open source project built by Alteryx. To see the other open source projects we’re working on visit Alteryx Open Source. If building impactful data science pipelines is important to you or your business, please get in touch.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file woodwork-0.21.1.tar.gz
.
File metadata
- Download URL: woodwork-0.21.1.tar.gz
- Upload date:
- Size: 186.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea639d922159d169b425c06ad267dc960788374d0e143631debe9a7338b1ccc2 |
|
MD5 | 7f1f2ffd07daeb9bd24bc90d25f17029 |
|
BLAKE2b-256 | 1e17001a66a7b9c32a1d77be47d74d1c5287f8edd93ae5350ebf017920268906 |
File details
Details for the file woodwork-0.21.1-py3-none-any.whl
.
File metadata
- Download URL: woodwork-0.21.1-py3-none-any.whl
- Upload date:
- Size: 230.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4040e491cb5a7c5bb9492e1b4f5477cc36fcab41ef56d13f3679483bbf681e41 |
|
MD5 | 932fde966cf1cc6e53a2a36cbfcee552 |
|
BLAKE2b-256 | 9893076fd672c5282b8efa62c8fbddf130c08d70f1e1e3f9fe45366ec0d39684 |