cuvis_ai.deciders.multiclass_decider.MultiClassDecider
- class cuvis_ai.deciders.multiclass_decider.MultiClassDecider(n: int, use_min: bool = False)[source]
Bases:
BaseDecider
Simple multi-class maximum decider. Given a matrix with N channels, chooses the channel with the highest value per spatial location. The result will be a single channel matrix with the indices of the chosen channels as values.
Methods
__init__
(n[, use_min])Create multi-class decider instance
Check that the parameters for the input data data match user expectations
Check that the parameters for the output data data match user expectations
fit
(X)forward
(X)Apply the maximum classification on the data.
load
(params, filepath)Load this node from a serialized graph.
serialize
(directory)Convert the class into a serialized representation
set_fit_meta_request
(**kwargs)set_forward_meta_request
(**kwargs)Attributes
Returns the needed shape for the input data.
Returns the provided shape for the output data.
- check_input_dim(X)
Check that the parameters for the input data data match user expectations
Parameters: X (array-like): Input data.
Returns: (Bool) Valid data
- check_output_dim(X)
Check that the parameters for the output data data match user expectations
Parameters: X (array-like): Input data.
Returns: (Bool) Valid data
- fit(X)
- forward(X: ndarray) ndarray [source]
Apply the maximum classification on the data. :param X: Data to apply the classification on. :type X: np.ndarray
- Returns:
Classified data. Single channel matrix comprised of the channel indices of the chosen classes.
- Return type:
np.ndarray
- get_fit_requested_meta()
- get_forward_requested_meta()
- property input_dim
Returns the needed shape for the input data. If a dimension is not important, it will return -1 in the specific position.
Returns: (tuple) needed shape for data
- property output_dim
Returns the provided shape for the output data. If a dimension is not important it will return -1 in the specific position.
- Returns:
Provided shape for data
- Return type:
- set_fit_meta_request(**kwargs)
- set_forward_meta_request(**kwargs)