Class Feature
java.lang.Object
es.uam.eps.ir.relison.links.data.ml.features.Feature
public class Feature
extends java.lang.Object
Stores the information about an attribute.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
name
Name of the attribute.private FeatureType
type
Type of the attribute.private java.util.List<java.lang.String>
values
The list of possible values of a nominal attribute. -
Constructor Summary
Constructors Constructor Description Feature(java.lang.String name, FeatureType type)
Constructor. -
Method Summary
Modifier and Type Method Description boolean
addValue(java.lang.String value)
In case the attribute is not continuous, adds a new possible value.java.lang.String
getName()
Get the attribute name.FeatureType
getType()
Get the attribute type.java.lang.String
getValue(int attr)
Get an individual attribute value.java.util.List<java.lang.String>
getValues()
Get the attribute values.
-
Field Details
-
Constructor Details
-
Feature
Constructor.- Parameters:
name
- Name of the attribute.type
- Type of the attribute.
-
-
Method Details
-
addValue
public boolean addValue(java.lang.String value)In case the attribute is not continuous, adds a new possible value.- Parameters:
value
- the value.- Returns:
- true if the value is correctly added, false if it is not.
-
getName
public java.lang.String getName()Get the attribute name.- Returns:
- The attribute name.
-
getType
Get the attribute type.- Returns:
- The attribute type.
-
getValues
public java.util.List<java.lang.String> getValues()Get the attribute values.- Returns:
- the attribute values if it is not continuous, an empty list if not.
-
getValue
public java.lang.String getValue(int attr)Get an individual attribute value.- Parameters:
attr
- the index of the value to retrieve.- Returns:
- the attribute value if it exists, an empty list if not.
-