All Superinterfaces:
org.apache.lucene.util.Accountable
All Known Subinterfaces:
BoundedInferenceModel
All Known Implementing Classes:
BoundedWindowInferenceModel, EnsembleInferenceModel, LangIdentNeuralNetwork, TreeInferenceModel

public interface InferenceModel extends org.apache.lucene.util.Accountable
  • Method Details

    • extractFeatures

      static double[] extractFeatures(String[] featureNames, Map<String,Object> fields)
    • getFeatureNames

      String[] getFeatureNames()
      Returns:
      The feature names in their desired order
    • targetType

      TargetType targetType()
      Returns:
      TargetType for the model.
    • infer

      InferenceResults infer(Map<String,Object> fields, InferenceConfig config, @Nullable Map<String,String> featureDecoderMap)
      Infer against the provided fields
      Parameters:
      fields - The fields and their values to infer against
      config - The configuration options for inference
      featureDecoderMap - A map for decoding feature value names to their originating feature. Necessary for feature influence.
      Returns:
      The predicted value. For classification this will be discrete values (e.g. 0.0, or 1.0). For regression this is continuous.
    • infer

      InferenceResults infer(double[] features, InferenceConfig config)
      Same as infer(Map, InferenceConfig, Map) but the features are already extracted.
    • supportsFeatureImportance

      boolean supportsFeatureImportance()
      Returns:
      Does the model support feature importance
    • getName

      String getName()
    • rewriteFeatureIndices

      void rewriteFeatureIndices(Map<String,Integer> newFeatureIndexMapping)
      Rewrites underlying feature index mappings. This is to allow optimization of the underlying models.