fatf.transparency.models.feature_influence
.merge_ice_arrays¶
-
fatf.transparency.models.feature_influence.
merge_ice_arrays
(ice_arrays_list: List[numpy.ndarray]) → numpy.ndarray[source]¶ Merges multiple Individual Conditional Expectation arrays.
This function allows you to merge Individual Conditional Expectation arrays into a single array as long as they were calculated for the same feature and for the same number of classes. This may be helpful when evaluating ICE for a model over multiple cross-validation folds or for multiple models.
- Parameters
- ice_arrays_listList[numpy.ndarray]
A list of Individual Conditional Expectation arrays to be merged.
- Returns
- ice_arraysnumpy.ndarray
All of the ICE arrays merged together alongside the first dimension (number of instances).
- Raises
- IncorrectShapeError
One of the ICE arrays is not 3-dimensional.
- TypeError
The
ice_arrays_list
input parameter is not a list.- ValueError
The list of ICE arrays to be merged is empty. One of the ICE arrays is not a numerical array. One of the ICE arrays is structured. Some of the ICE arrays do not share the same second (number of steps) or third (number of classes) dimension or type.