Package com.spotify.zoltar
Interface Predictor<InputT,ValueT>
-
- Type Parameters:
InputT
- type of the feature extraction input.ValueT
- type of the prediction output.
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Predictor<InputT,ValueT>
Entry point for prediction, it allows to perform E2E prediction given a recipe made of aModel
,FeatureExtractor
and aPredictFns.PredictFn
. In most cases you should use the static factory methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CompletionStage<List<Prediction<InputT,ValueT>>>
predict(InputT... input)
Perform prediction with a default scheduler, and practically infinite timeout.default CompletionStage<List<Prediction<InputT,ValueT>>>
predict(Duration timeout, InputT... input)
Perform prediction with a default scheduler.CompletionStage<List<Prediction<InputT,ValueT>>>
predict(ScheduledExecutorService scheduler, Duration timeout, InputT... input)
Functional interface.default PredictorTimeoutScheduler
timeoutScheduler()
timeout scheduler for predict functions.
-
-
-
Method Detail
-
timeoutScheduler
default PredictorTimeoutScheduler timeoutScheduler()
timeout scheduler for predict functions.
-
predict
CompletionStage<List<Prediction<InputT,ValueT>>> predict(ScheduledExecutorService scheduler, Duration timeout, InputT... input)
Functional interface. You should perform E2E feature extraction and prediction. SeeDefaultPredictorBuilder.create(ModelLoader, FeatureExtractor, AsyncPredictFn)
for an example of usage.- Parameters:
input
- a list of inputs to perform feature extraction and prediction on.timeout
- implementation specific timeout.scheduler
- implementation specific scheduler.
-
predict
default CompletionStage<List<Prediction<InputT,ValueT>>> predict(Duration timeout, InputT... input)
Perform prediction with a default scheduler.
-
predict
default CompletionStage<List<Prediction<InputT,ValueT>>> predict(InputT... input)
Perform prediction with a default scheduler, and practically infinite timeout.
-
-