Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.96 KB

File metadata and controls

59 lines (40 loc) · 1.96 KB

description: Apply a schema to an expression.

Module: expression_impl.apply_schema

View source on GitHub

Apply a schema to an expression.

A tensorflow metadata schema ( detailed information about the data: specifically, it presents domain information (e.g., not just integers, but integers between 0 and 10), and more detailed structural information (e.g., this field occurs in at least 70% of its parents, and when it occurs, it shows up 5 to 7 times).

Applying a schema attaches a tensorflow metadata schema to an expression: namely, it aligns the features in the schema with the expression's children by name (possibly recursively).

After applying a schema to an expression, one can use promote, broadcast, et cetera, and the schema for new expressions will be inferred. If you write a custom expression, you can write code that determines the schema information of the result.

To get the schema back, call get_schema().

This does not filter out fields not in the schema.

my_expr = ... my_schema = ...schema here... my_new_schema = my_expr.apply_schema(my_schema).get_schema() my_new_schema has semantically identical information on the fields as my_schema.

  1. Get the (non-deprecated) paths from a schema.
  2. Check if any paths in the schema are not in the expression.
  3. Check if any paths in the expression are not in the schema.
  4. Project the expression to paths in the schema.

Functions

apply_schema(...)