inference
Algorithm to evaluate a model on remote data.
Classes
ModelInference
class ModelInference(    *,    model: INFERRABLE_MODEL_TR,    class_outputs: Optional[list[str]] = None,    postprocessors: Optional[list[dict[str, Any]]] = None,    pretrained_file: Optional[Union[str, os.PathLike]] = None,    project_id: Optional[str] = None,):Algorithm for running inference on a model and returning the predictions.
danger
This algorithm could potentially return the data unfiltered so should only be used when the other party is trusted.
Arguments
class_outputs: A list of strings corresponding to prediction outputs. If provided, the model will return a dataframe of results with the class outputs list elements as columns. Defaults to None.model: The model to infer on remote data.postprocessors: Post-processing configuration, which can be either a preset string or a list of postprocessor configuration dicts.pretrained_file: A file path or a string containing a pre-trained model. Defaults to None.
Attributes
class_name: The name of the algorithm class.class_outputs: A list of strings corresponding to prediction outputs. If provided, the model will return a dataframe of results with the class outputs list elements as columns. Defaults to None.fields_dict: A dictionary mapping all attributes that will be serialized in the class to their marshmallow field type. (e.g. fields_dict ={"class_name": fields.Str()}).model: The model to infer on remote data.nested_fields: A dictionary mapping all nested attributes to a registry that contains class names mapped to the respective classes. (e.g. nested_fields ={"datastructure": datastructure.registry})postprocessors: A list of postprocessor configuration dicts. Defaults to None.pretrained_file: A file path or a string containing a pre-trained model. Defaults to None.
Ancestors
- bitfount.federated.algorithms.model_algorithms.base._BaseModelAlgorithmFactory
 - BaseAlgorithmFactory
 - abc.ABC
 - bitfount.federated.roles._RolesMixIn
 - bitfount.types._BaseSerializableObjectMixIn
 - typing.Generic
 
Variables
- static 
fields_dict : ClassVar[dict[str, marshmallow.fields.Field]] 
Methods
create
def create(self, role: Union[str, Role], **kwargs: Any) ‑> Any:Create an instance representing the role specified.
modeller
def modeller(    self, *, context: ProtocolContext, **kwargs: Any,) ‑> bitfount.federated.algorithms.model_algorithms.inference._ModellerSide:Returns the modeller side of the ModelInference algorithm.
worker
def worker(    self, *, hub: BitfountHub, context: ProtocolContext, **kwargs: Any,) ‑> bitfount.federated.algorithms.model_algorithms.inference._WorkerSide:Returns the worker side of the ModelInference algorithm.
Arguments
hub:BitfountHubobject to use for communication with the hub.context: Optional. Run-time protocol context details for running. May contain URLs for downloading models directly rather than from the hub.- **
**kwargs**: Additional keyword arguments to pass to the worker side. 
Returns Worker side of the ModelInference algorithm.