Choose the right adapter for your use case.
Choose the first row below whose condition applies:
| Condition | Adapter |
|---|
| Data too large to fit in memory | Streaming |
| Fits in memory, need real-time/incremental updates | Online |
| Fits in memory, no real-time requirement | Batch |
| Mode | Use Case | Memory | Features |
|---|
| Batch | Complete datasets | Full | All features |
| Streaming | Large files (>100K) | Chunked | Residuals, robustness |
| Online | Real-time sensors | Fixed window | Incremental updates |

Standard mode for complete datasets. Supports all features.
- Dataset fits in memory
- Need intervals, cross-validation, or diagnostics
- Processing complete files
using FastLOWESS
using Random, Statistics
rng = MersenneTwister(42)
x = collect(range(0, 2π, length=100))
y = sin.(x) .+ randn(rng, 100) .* 0.3
model = Lowess(;
fraction=0.5,
iterations=3,
parallel=true,
outputs=["diagnostics"],
intervals=(confidence=0.95, prediction=0.95),
)
result = fit(model, x, y)
println("95% CI at midpoint: [", result.confidence_lower[51], ", ", result.confidence_upper[51], "]")
println("R2: ", result.diagnostics.r_squared)
95% CI at midpoint: [-0.01832864538240274, 0.17819422334560386]
R2: 0.7909162309681064
Process large datasets in chunks with configurable overlap.
- Dataset >100,000 points
- Memory-constrained environments
- Batch processing pipelines
| Parameter | Default | Description |
|---|
chunk_size | 5000 | Points per chunk |
overlap | chunk_size / 10 | Overlap between chunks |
merge_strategy | "weighted_average" | How to merge overlaps |
| Strategy | Behavior |
|---|
"average" | Average overlapping values |
"weighted_average" | Distance-weighted blend |
"take_first" | Keep left chunk values |
"take_last" | Keep right chunk values |
using FastLOWESS
using Random, Statistics
rng = MersenneTwister(42)
x = collect(range(0, 2π, length=100))
y = sin.(x) .+ randn(rng, 100) .* 0.3
model = StreamingLowess(;
fraction=0.3,
iterations=2,
chunk_size=5000,
overlap=500,
merge_strategy="average"
)
process_chunk(model, x, y)
result = finalize(model)
println("Smoothed y[0]: ", result.y[1])
Smoothed y[0]: 0.35383694154729933
Always call finalize(model) after processing all chunks to retrieve buffered overlap data.
Incremental updates with a sliding window for real-time data.
- Data arrives incrementally (sensors, streams)
- Need real-time smoothed values
- Fixed memory budget
| Parameter | Default | Description |
|---|
window_capacity | 1000 | Max points in window |
min_points | 2 | Points before output starts |
update_mode | "incremental" | Update strategy |
| Mode | Behavior | Speed |
|---|
"incremental" | Update only affected fits | Faster |
"full" | Recompute entire window | More accurate |
using FastLOWESS
using Random, Statistics
rng = MersenneTwister(42)
x = collect(range(0, 2π, length=100))
y = sin.(x) .+ randn(rng, 100) .* 0.3
model = OnlineLowess(;
fraction=0.2,
window_capacity=100,
min_points=5,
update_mode="incremental"
)
shown = 0
for i in eachindex(x)
global shown
result = add_point(model, x[i], y[i])
if result !== nothing && shown < 5
println("Current smoothed value: ", result.y)
shown += 1
end
end
Current smoothed value: 0.23103531694201596
Current smoothed value: 0.4962273769575686
Current smoothed value: 0.6767458589597115
Current smoothed value: 0.41363571386216635
Current smoothed value: 0.31508056492212055
| Feature | Batch | Streaming | Online |
|---|
| Confidence intervals | ✓ | ✗ | ✗ |
| Prediction intervals | ✓ | ✗ | ✗ |
| Cross-validation | ✓ | ✗ | ✗ |
| Diagnostics | ✓ | ✓ | ✗ |
| Residuals | ✓ | ✓ | ✓ |
| Robustness weights | ✓ | ✓ | ✓ |
| Parallel execution | ✓ | ✓ | ✗ |