mlpy.knowledgerep.cbr.engine.Case.add_feature

Case.add_feature(name, _type, value, **kwargs)[source]

Add a new feature.

Parameters:

name : str

The name of the feature (this also serves as the features identifying key).

_type : str

The type of the feature. Valid feature types are:

bool

The feature values are boolean types (BoolFeature).

string

The feature values are of types sting (StringFeature).

int

The feature values are of type integer (IntFeature).

float

The feature values are of type float (FloatFeature).

value : bool or string or int or float or list

The feature value.

Other Parameters:
 

weight : float or list[float]

The weights given to each feature value.

is_index : bool

Flag indicating whether this feature is an index.

retrieval_method : str

The similarity model used for retrieval. Refer to Feature.retrieval_method for valid methods.

retrieval_method_params : dict

Parameters relevant to the selected retrieval method.

retrieval_algorithm : str

The internal indexing structure of the training data. Refer to Feature.retrieval_method for valid algorithms.

retrieval_metric : str

The metric used to compute the distances between pairs of points. Refer to sklearn.neighbors.DistanceMetric for valid identifiers.

retrieval_metric_params : dict

Parameters relevant to the specified metric.