cuvis_ai.deciders.binary_decider.BinaryDecider

class cuvis_ai.deciders.binary_decider.BinaryDecider(threshold: float = 1.0)[source]

Bases: BaseDecider

Simple decider node using a static threshold to classify data.

Parameters:

threshold (Any) – The threshold to use for classification: result = (input >= threshold)

__init__(threshold: float = 1.0) None[source]

Methods

__init__([threshold])

check_input_dim(X)

Check that the parameters for the input data data match user expectations

check_output_dim(X)

Check that the parameters for the output data data match user expectations

fit(X)

forward(X)

Apply binary decision on input data.

get_fit_requested_meta()

get_forward_requested_meta()

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

input_dim

Returns the needed shape for the input data.

output_dim

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 binary decision on input data.

Paramaters

Xnp.ndarray

Input data as numpy array

returns:

Classified input data. Where the datapoints are False if smaller than the threshold or True if larger or equal.

rtype:

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:

Needed shape for data

Return type:

tuple

load(params: dict, filepath: str)[source]

Load this node from a serialized graph.

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:

tuple

serialize(directory: str)[source]

Convert the class into a serialized representation

set_fit_meta_request(**kwargs)
set_forward_meta_request(**kwargs)