InferenceEngine

public interface InferenceEngine

Interface for making inference (WORK-IN-PROGRESS)

Author:James Liu

Methods

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

getNumOutputGroup

public int getNumOutputGroup()

Get the number of output groups 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 output groups

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_output_group]