Module org.elasticsearch.xcore
Interface InferenceModel
- All Superinterfaces:
org.apache.lucene.util.Accountable
- All Known Implementing Classes:
EnsembleInferenceModel,LangIdentNeuralNetwork,TreeInferenceModel
public interface InferenceModel
extends org.apache.lucene.util.Accountable
-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]extractFeatures(String[] featureNames, Map<String, Object> fields) String[]getName()infer(double[] features, InferenceConfig config) Same asinfer(Map, InferenceConfig, Map)but the features are already extracted.Infer against the provided fieldsvoidrewriteFeatureIndices(Map<String, Integer> newFeatureIndexMapping) Rewrites underlying feature index mappings.booleanMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsed
-
Method Details
-
extractFeatures
-
getFeatureNames
String[] getFeatureNames()- Returns:
- The feature names in their desired order
-
targetType
TargetType targetType()- Returns:
TargetTypefor 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 againstconfig- The configuration options for inferencefeatureDecoderMap- 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
Same asinfer(Map, InferenceConfig, Map)but the features are already extracted. -
supportsFeatureImportance
boolean supportsFeatureImportance()- Returns:
- Does the model support feature importance
-
getName
String getName() -
rewriteFeatureIndices
Rewrites underlying feature index mappings. This is to allow optimization of the underlying models.
-