The model configuration is included in the process of uploading models to Openlayer. It is usually provided as a dictionary/object or as a YAML file. Refer to the API reference for details on the upload process.

Note that the notion of uploading a model only applies to development projects. If you are working with monitoring, you only need to upload/stream production data.

Attributes

For text classification models, the config can contain the following attributes. Note that not all attributes are required, as some contain default values.

AttributeTypeDefaultDescriptionComments
architectureTypestr“custom”The model’s framework.Must be one of: sklearn, xgboost, fasttext, keras, pytorch, rasa, tensorflow, transformers, llm. If the framework being used is not one of the above, use custom.
classNamesList[str]-List of class names corresponding to the outputs of your prediction function.E.g. [“Retained”, “Exited”].
metadataDict[str, any]{}Dictionary containing metadata about the model.This is the metadata that will be displayed on the Openlayer platform.
namestr“Model”Name of the model.
predictionThresholdfloatNoneThe threshold used to determine the predicted class.Applies only if you are using a binary classifier and you provided the predictionScoresColumnName with the lists of class probabilities in your datasets. If you provided predictionScoresColumnName but not predictionThreshold, the predicted class is defined by the argmax of the lists in predictionScoresColumnName.

Examples

Let’s look at an example dataset from one of the sample notebooks from Openlayer’s examples gallery GitHub repository.

A valid model_config.yaml file would be:

architectureType: sklearn
classNames:
  - negative
  - positive
metadata:
  model_type: Logistic Regression
  regularization: None
name: Sentiment analysis model