predict_maxfit

Performs a relevance-based maxfit prediction using the CSA Prediction Engine API.

This method determines the optimal relevance-based prediction by evaluating adjusted fit across various thresholds for the input data.

This function supports three types of prediction tasks:

  1. Single prediction task: A single dependent variable and a single set of circumstances.

  2. Multi-y prediction task: Multiple dependent variables (y) with a single set of circumstances (theta).

  3. Multi-theta prediction task: A single dependent variable with multiple sets of circumstances (theta).

Multi-y and multi-theta prediction tasks cannot be performed simultaneously. Ensure that your input dimensions are structured accordingly, i.e., you can loop through multiple calls to handle these cases separately.

Parameters

y : ndarray

Dependent variable(s) represented as either:

  • Single task: Column vector [N-by-1]

  • Multi-y task: Matrix [N-by-Q], where Q is the number of dependent variables.

X : ndarray

Independent variables matrix of shape [N-by-K], where K is the number of features.

theta : ndarray

Circumstances represented as either

  • Single task: Row vector [1-by-K].

  • Multi-theta task: Matrix [Q-by-K], where Q is the number of different sets of circumstances.

options : MaxFitOptions

Configuration object containing key-value parameters required for the maxfit prediction task.

Returns

yhat : ndarray

Predicted outcome(s) based on the input data and circumstances.

yhat_details : dict

Dictionary containing additional details about the prediction model and results.


Raises

Last updated