FileDocCategorySizeDatePackage
Learning_MulticlassPA.javaAPI DocAndroid 5.1 API3073Thu Mar 12 22:22:48 GMT 2015android.bordeaux.services

Learning_MulticlassPA

public class Learning_MulticlassPA extends ILearning_MulticlassPA.Stub implements IBordeauxLearner

Fields Summary
private android.bordeaux.learning.MulticlassPA
mMulticlassPA_learner
private ModelChangeCallback
modelChangeCallback
Constructors Summary
public Learning_MulticlassPA()

        mMulticlassPA_learner = new MulticlassPA(2, 2, 0.001f);
    
Methods Summary
public intClassify(java.util.List sample)

        IntFloatArray splited = splitIntFloatArray(sample);
        int prediction = mMulticlassPA_learner.sparseGetClass(splited.indexArray,
                                                              splited.floatArray);
        return prediction;
    
public voidTrainOneSample(java.util.List sample, int target)

        IntFloatArray splited = splitIntFloatArray(sample);
        mMulticlassPA_learner.sparseTrainOneExample(splited.indexArray,
                                                    splited.floatArray,
                                                    target);
        if (modelChangeCallback != null) {
            modelChangeCallback.modelChanged(this);
        }
    
public android.os.IBindergetBinder()

        return this;
    
public byte[]getModel()

        return null;
    
public booleansetModel(byte[] modelData)

        return false;
    
public voidsetModelChangeCallback(ModelChangeCallback callback)

        modelChangeCallback = callback;
    
private android.bordeaux.services.Learning_MulticlassPA$IntFloatArraysplitIntFloatArray(java.util.List sample)

    

        
        IntFloatArray splited = new IntFloatArray();
        ArrayList<IntFloat> s = (ArrayList<IntFloat>)sample;
        splited.indexArray = new int[s.size()];
        splited.floatArray = new float[s.size()];
        for (int i = 0; i < s.size(); i++) {
            splited.indexArray[i] = s.get(i).index;
            splited.floatArray[i] = s.get(i).value;
        }
        return splited;