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

    Fields 
    Modifier and Type Field Description
    private int classIdx
    The index of the class attribute in the list.
    private java.util.List<Feature> features
    The list of features.
  • Constructor Summary

    Constructors 
    Constructor Description
    Features​(java.util.List<Feature> attrs, int classIdx)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getAttributeName​(int idx)
    Get the name of the attribute
    FeatureType getAttributeType​(int idx)
    Get the attribute type.
    java.lang.String getAttributeValue​(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.String getClassValue​(int attr)
    Get the values of the class attribute.
    java.util.List<java.lang.String> getClassValues()
    Get the values of the class attribute.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • features

      private final java.util.List<Feature> features
      The list of features.
    • classIdx

      private final int classIdx
      The index of the class attribute in the list.
  • Constructor Details

    • Features

      public Features​(java.util.List<Feature> attrs, int classIdx)
      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

      public FeatureType getAttributeType​(int idx)
      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.