trustyai.model.feature
- trustyai.model.feature(name: str, dtype: str, value=None, domain=None) Feature
Create a Java
Feature. TheFeatureclass 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:
categoricalfor categorical features.numberfor numeric features.boolfor 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:
FeatureA TrustyAI
Featureobject, to be used in thesimple_prediction()orcounterfactual_prediction()functions.