trustyai.model.feature

trustyai.model.feature(name: str, dtype: str, value=None, domain=None) Feature

Create a Java Feature. The Feature class is used to represent the individual components (or features) of input data points.

Parameters:
namestr

The name of the given feature.

dtype: str

The type of the given feature, one of:

  • categorical for categorical features.

  • number for numeric features.

  • bool for binary or boolean features.

If dtype is unspecified or takes a different value than listed above, the feature type will be taken as a generic object.

valueAny

The value of this feature.

domainUnion[tuple, list]

A tuple or list that defines the feature domain. A tuple will define a numeric range from [tuple[0], tuple[1]), while a list defines the valid values for a categorical feature.

Returns:
Feature

A TrustyAI Feature object, to be used in the simple_prediction() or counterfactual_prediction() functions.