Model Schema#
Creation#
To create a ModelSchema, the schema of the Model inputs and/or Model ouputs has to be defined beforehand.
Schema#
hsml.schema.Schema(object=None)
Create a schema for a model input or output.
Arguments
- object
Optional[Union[pandas.core.frame.DataFrame, pandas.core.series.Series, pyspark.sql.dataframe.DataFrame, hsfs.training_dataset.TrainingDataset, numpy.ndarray, list]]
: The object to construct the schema from.
Returns
Schema
. The schema object.
After defining the Model inputs and/or outputs schemas, a ModelSchema can be created using its class constructor.
ModelSchema#
hsml.model_schema.ModelSchema(input_schema=None, output_schema=None)
Create a schema for a model.
Arguments
- input_schema
Optional[hsml.schema.Schema]
: Schema to describe the inputs. - output_schema
Optional[hsml.schema.Schema]
: Schema to describe the outputs.
Returns
ModelSchema
. The model schema object.
Retrieval#
Model Schema#
Model schemas can be accessed from the model metadata objects.
model.model_schema
Model Input & Ouput Schemas#
The schemas of the Model inputs and outputs can be accessed from the ModelSchema metadata objects.
model_schema.input_schema
model_schema.output_schema
Methods#
to_dict#
Schema.to_dict()
Get dict representation of the Schema.
to_dict#
ModelSchema.to_dict()
Get dict representation of the ModelSchema.