Documentation of 'smile.feature.SparseOneHotEncoder' Java class
SparseOneHotEncoder
smile.feature

Class SparseOneHotEncoder



  • public class SparseOneHotEncoder
    extends java.lang.Object
    Encode categorical integer features using sparse one-hot scheme. All variables should be nominal attributes and will be converted to binary dummy variables in a compact representation in which only indices of nonzero elements are stored in an integer array. In Maximum Entropy Classifier, the data are expected to store in this format.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int[] feature(double[] x)
      Generates the compact representation of sparse binary features for given object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SparseOneHotEncoder

        public SparseOneHotEncoder(Attribute[] attributes)
        Constructor.
        Parameters:
        attributes - the variable attributes. All of them have to be nominal attributes.
    • Method Detail

      • feature

        public int[] feature(double[] x)
        Generates the compact representation of sparse binary features for given object.
        Parameters:
        x - an object of interest.
        Returns:
        an integer array of nonzero binary features.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.