trustyai.model.simple_prediction
- trustyai.model.simple_prediction(input_features: int | float | integer | inexact | ndarray | DataFrame | Series | List[Feature] | PredictionInput, outputs: int | float | integer | inexact | ndarray | DataFrame | Series | List[Output] | PredictionOutput, feature_names: List[str] | None = None, output_names: List[str] | None = None) SimplePrediction
Wrap features and outputs into a SimplePrediction. Given a list of features and outputs, this function will bundle them into Prediction objects for use with the LIME and SHAP explainers.
- Parameters:
- input_featuresint, float,
numpy.number, List[Union[int, float,numpy.number]],numpy.ndarray,pandas.DataFrame,pandas.Series, List[Feature], orPredictionInput List of input features, as a:
If there’s only a single input feature, an
int,float, or any of the Numpy equivalents can be used.A list of
int,float, or any of the Numpy equivalents.Numpy array of shape
[1, n_features]or[n_features]Pandas DataFrame with 1 row and
n_featurescolumnsPandas Series with n_features rows
A List of TrustyAI
Feature, as created by thefeature()functionA TrustyAI
PredictionInput
- outputsint, float,
numpy.number, List[Union[int, float,numpy.number]],numpy.ndarray,pandas.DataFrame,pandas.Series, List[Output], orPredictionOutput The desired model outputs to be searched for in the counterfactual explanation. These can take the form of a:
If there’s only a single output, an
int,float, or any of the Numpy equivalents can be used.A list of
int,float, or any of the Numpy equivalents.Numpy array of shape
[1, n_outputs]or[n_outputs]Pandas DataFrame with 1 row and
n_outputscolumnsPandas Series with n_outputs rows
A List of TrustyAI
Output, as created by theoutput()functionA TrustyAI
PredictionOutput
- feature_names: Optional[List[str]]
The names of the features, in the case where the feature object does not contain them
- output_names: Optional[List[str]]
The names of the outputs, in the case where the outputobject does not contain them
- input_featuresint, float,