Model.predict()

Contents

Model.predict()#

Model.predict(samples, predict=None, newdata=None, chunk_size=64)[source]#

Returns a dictionary of predictions.

Parameters:
  • samples (Position (dict[str, Any])) – Dictionary of samples at which to evaluate predictions. If samples contains entries for weak variables or for nodes in model_nodes they are ignored.

  • predict (Sequence[str] | None, default: None) – Sequence of strings, which are the names of nodes or variables. Predictions will be returned only for the nodes or variables inlcuded here. If None (default), predictions will be returned for all variables in the model (but not for nodes).

  • newdata (Position (dict[str, Any]) | None, default: None) – Dictionary of new data at which to evaluate predictions. The keys should correspond to variable or node names in the model whose values should be set to the given values before evaluating predictions. If None (default), the current variable values are used.

  • chunk_size (int | None, default: 64) – Maximum number of flattened samples to evaluate in parallel. Defaults to 64. Pass None to evaluate all samples in parallel. A smaller value reduces the peak memory required for sample-dependent intermediate values, at the potential cost of lower accelerator utilization. It does not reduce the memory required to store the returned predictions.

Return type:

dict[str, Any]