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§
Required Methods§
Sourcefn predict_async_batched<'a>(
&'a self,
x: &'a X,
config: &'a AsyncConfig,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'a>>
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
Sourcefn 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_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
Sourcefn predict_async_with_uncertainty<'a>(
&'a self,
x: &'a X,
confidence_level: f64,
) -> AsyncPredictConfidenceFuture<'a, Output>where
Self: 'a,
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)