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, **kwargs)
Create a schema for a model input or output.
Arguments
- object
pandas.DataFrame | pandas.core.series.Series | hsml.schema.pyspark.sql.dataframe.DataFrame | hsml.schema.hsfs.training_dataset.TrainingDataset | numpy.ndarray | list | None
: 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, **kwargs)
Create a schema for a model.
Arguments
- input_schema
hsml.schema.Schema | None
: Schema to describe the inputs. - output_schema
hsml.schema.Schema | None
: 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.