predict_grid
Performs a relevance-based grid prediction using the CSA Prediction Engine API.
This method generates an optimal composite prediction by evaluating all thresholds and all variable combinations for the input data.
This function supports three types of prediction tasks:
Single prediction task: A single dependent variable and a single set of circumstances.
Multi-y prediction task: Multiple dependent variables (y) with a single set of circumstances (theta).
Multi-theta prediction task: A single dependent variable with multiple sets of circumstances (theta).
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 : GridOptions
Configuration object containing key-value parameters required for the grid 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
Raises a ValueError if both multi-y and multi-theta are specified simultaneously, or if the dimensions of y
, X
, and theta
are not compatible.
Last updated