Skip to content

Conversation

marcromeyn
Copy link
Contributor

@marcromeyn marcromeyn commented Sep 10, 2021

This PR makes it possible for users to define a schema manually in code. An example of that:

schema.Schema(
    [
        schema.ColumnSchema.create_continuous("con_1"),
        schema.ColumnSchema.create_continuous("con_2_int", is_float=False),
        schema.ColumnSchema.create_categorical("cat_1", 1000),
        schema.ColumnSchema.create_categorical(
            "cat_2", 100, value_count=schema.ValueCount(1, 20)
        ),
    ]
)

I will add more docs around this in a future PR, but will merge this now to make sure all our examples/tutorials can already make use of the updated schema.

Copy link
Member

@benfred benfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

@marcromeyn marcromeyn merged commit 2b202fc into main Sep 13, 2021
@marcromeyn marcromeyn deleted the schema/updates branch September 13, 2021 10:10
mikemckiernan pushed a commit to mikemckiernan/Transformers4Rec that referenced this pull request Nov 15, 2022
* Experimenting with ways to define a Schema

* Adding create_continuous

* Adding create_continuous

* Adding prototext support

* Refactoring Schema

* Fixing flake8

* Updating requirements

* Trying to fix failing tests

* Fixing failing schema tests

* Fixing failing schema tests

* Change call of from_proto_txt to new signature

* Rename Tags to Tag like it was before

* Fixing test_tabular_features_yoochoose_direct

* Update tests/utils/test_schema.py

Co-authored-by: Ben Frederickson <github@benfrederickson.com>

* Fixes according to PR-comments

* Running flake8

* Adding copyright + some basic tag tests

* Some more updates

* Some small refactorings of Schema

* Some more tests

* Trying to fix failing tests

Co-authored-by: Ben Frederickson <github@benfrederickson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants