AsyncPredictAdvanced

Trait AsyncPredictAdvanced 

Source
pub trait AsyncPredictAdvanced<X, Output> {
    type Error: Error + Send + Sync;

    // Required methods
    fn predict_async_batched<'a>(
        &'a self,
        x: &'a X,
        config: &'a AsyncConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'a>>;
    fn predict_stream<'a>(
        &'a self,
        x_stream: Pin<Box<dyn Stream<Item = X> + Send + 'a>>,
        config: &'a AsyncConfig,
    ) -> Pin<Box<dyn Stream<Item = Result<Output>> + Send + 'a>>;
    fn predict_async_with_uncertainty<'a>(
        &'a self,
        x: &'a X,
        confidence_level: f64,
    ) -> AsyncPredictConfidenceFuture<'a, Output>
       where Self: 'a;
}
Expand description

Enhanced async predict trait with batch processing

Required Associated Types§

Source

type Error: Error + Send + Sync

Error type

Required Methods§

Source

fn predict_async_batched<'a>( &'a self, x: &'a X, config: &'a AsyncConfig, ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'a>>

Make predictions asynchronously with batching

Source

fn predict_stream<'a>( &'a self, x_stream: Pin<Box<dyn Stream<Item = X> + Send + 'a>>, config: &'a AsyncConfig, ) -> Pin<Box<dyn Stream<Item = Result<Output>> + Send + 'a>>

Stream predictions for large datasets

Source

fn predict_async_with_uncertainty<'a>( &'a self, x: &'a X, confidence_level: f64, ) -> AsyncPredictConfidenceFuture<'a, Output>
where Self: 'a,

Predict with confidence intervals (if supported)

Implementors§