InferenceEngine

public interface InferenceEngine

Interface for making inference (WORK-IN-PROGRESS)

Author

James Liu

Methods

getNumClass

public int getNumClass()

Get the number of classes for the compiled model. This number is 1 for tasks other than multi-class classification. For multi-class classification task, the number is equal to the number of classes.

Returns

Number of classes

getNumFeature

public int getNumFeature()

Get the number of features used by the compiled model. Call this method to allocate array for storing data entries of a single instance.

Returns

Number of features

predict

public float[] predict(Data[] inst, boolean pred_margin)

Perform single-instance prediction

Parameters
  • inst – array of data entires(features) comprising the instance

  • pred_margin – whether to predict a probability or a raw margin score

Returns

Resulting predictions, of dimension [num_class]