Skip to content

predictionhandler

predictionhandler

Module for the abstract PredictionHandler

Classes

PredictionHandler

PredictionHandler()

Bases: ABC

Abstract PredictionHandler class to implement your own prediction handler

Source code in niceml/mlcomponents/predictionhandlers/predictionhandler.py
def __init__(self):
    self.exp_context = None
    self.filename = None
    self.data_description = None
Functions
add_prediction abstractmethod
add_prediction(data_info_list, prediction_batch)

Consumes a prediction batch and handles the predicted data to create an experiment output

Source code in niceml/mlcomponents/predictionhandlers/predictionhandler.py
@abstractmethod
def add_prediction(self, data_info_list: List[DataInfo], prediction_batch):
    """Consumes a prediction batch and handles the predicted data
    to create an experiment output"""
initialize
initialize(*args, **kwargs)

This method can be implemented if some initialization steps need values that are specified in set_params Returns:

Source code in niceml/mlcomponents/predictionhandlers/predictionhandler.py
def initialize(self, *args, **kwargs):
    """
    This method can be implemented if some initialization steps need
    values that are specified in set_params
    Returns:

    """