predict_psr

Performs a relevance-based partial sample regression prediction using the CSA Prediction Engine API.

Calculates partial sample regression predictions based on relevance using the CSA API.

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.

Configuration object containing key-value parameters required for the 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