Expand description
Resource usage forecasting with time series analysis.
This module provides forecasting capabilities for resource usage prediction using simple linear regression and moving averages.
§Features
- Linear trend forecasting
- Moving average smoothing
- Growth rate calculation
- Time-to-capacity estimation
- Anomaly detection in trends
§Example
use chie_core::forecasting::{Forecaster, ForecastMethod};
let mut forecaster = Forecaster::new(ForecastMethod::LinearRegression);
// Add historical data points
forecaster.add_sample(100.0);
forecaster.add_sample(150.0);
forecaster.add_sample(200.0);
forecaster.add_sample(250.0);
// Predict future value
if let Some(forecast) = forecaster.forecast(1) {
println!("Predicted value in 1 period: {:.2}", forecast);
}
// Estimate time to reach capacity
if let Some(periods) = forecaster.time_to_capacity(1000.0) {
println!("Will reach capacity in {} periods", periods);
}Structs§
- Capacity
Forecast - Resource capacity forecast.
- Forecaster
- A forecaster for time series data.
Enums§
- Forecast
Method - Forecasting methods.