Class Features
java.lang.Object
es.uam.eps.ir.relison.links.data.ml.features.Features
public class Features
extends java.lang.Object
A class for storing the set of attributes which might be used by a machine
learning approach.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description java.lang.StringgetAttributeName(int idx)Get the name of the attributeFeatureTypegetAttributeType(int idx)Get the attribute type.java.lang.StringgetAttributeValue(int idx, int attr)Get the values of an attribute.java.util.List<java.lang.String>getAttributeValues(int idx)Get the values of an attribute.java.lang.StringgetClassValue(int attr)Get the values of the class attribute.java.util.List<java.lang.String>getClassValues()Get the values of the class attribute.
-
Field Details
-
Constructor Details
-
Features
Constructor.- Parameters:
attrs- Attribute list.classIdx- The index of the class attribute in the list.
-
-
Method Details
-
getAttributeName
public java.lang.String getAttributeName(int idx)Get the name of the attribute- Parameters:
idx- index of the attribute- Returns:
- the name of the attribute, null if it does not exist.
-
getAttributeType
Get the attribute type.- Parameters:
idx- index of the attribute.- Returns:
- the type of the attribute, null if it does not exist.
-
getAttributeValues
public java.util.List<java.lang.String> getAttributeValues(int idx)Get the values of an attribute.- Parameters:
idx- index of the attribute.- Returns:
- the values of the attribute, an empty list if it is continuous, or null if it does not exist.
-
getAttributeValue
public java.lang.String getAttributeValue(int idx, int attr)Get the values of an attribute.- Parameters:
idx- index of the attribute.attr- the index of the attribute value.- Returns:
- the values of the attribute, an empty list if it is continuous, or null if it does not exist.
-
getClassValues
public java.util.List<java.lang.String> getClassValues()Get the values of the class attribute.- Returns:
- the values of the attribute, an empty list if it is continuous, or null if it does not exist.
-
getClassValue
public java.lang.String getClassValue(int attr)Get the values of the class attribute.- Parameters:
attr- the index of the attribute value.- Returns:
- the values of the attribute, an empty list if it is continuous, or null if it does not exist.
-