FileDocCategorySizeDatePackage
MulticlassPA.javaAPI DocAndroid 5.1 API2301Thu Mar 12 22:22:48 GMT 2015android.bordeaux.learning

MulticlassPA

public class MulticlassPA extends Object
Wrapper for multiclass passive aggressive classifier. version 1 supports indexed sparse feature only.

Fields Summary
private long
nativeClassifier
Constructors Summary
public MulticlassPA(int numClasses, int numDimensions, float aggressiveness)

      nativeClassifier = initNativeClassifier(numClasses, numDimensions,
                                              aggressiveness);
    
Methods Summary
private native voiddeleteNativeClassifier(long classPtr)

private native longinitNativeClassifier(int num_classes, int num_dims, float aggressiveness)

private native intnativeSparseGetClass(int[] index_array, float[] float_array, long classPtr)

private native booleannativeSparseTrainOneExample(int[] index_array, float[] float_array, int target, long classPtr)

public intsparseGetClass(int[] index_array, float[] float_array)
Train on one example

        return nativeSparseGetClass(index_array, float_array, nativeClassifier);
    
public booleansparseTrainOneExample(int[] index_array, float[] float_array, int target)
Train on one example

        return nativeSparseTrainOneExample(
                index_array, float_array, target, nativeClassifier);