Skip to content

Commit cd6f31f

Browse files
Show an example usage
1 parent e14eab1 commit cd6f31f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ To use this smoother in you project, add this to your `Cargo.toml`:
3535
whittaker_smoother = "0.1"
3636
```
3737

38+
Now you can use the smoothing function as such:
39+
```rust
40+
// Here we use the WOOD_DATASET, but this can be any series that you would like to smooth
41+
let raw = Vec::from_iter(WOOD_DATASET.iter().map(|v| *v as f64));
42+
let lambda = 2e4;
43+
let order = 3;
44+
let smoothed = whittaker_smoother(&raw, lambda, order).unwrap();
45+
```
46+
And BAM, that's it! There is you perfectly smoothed series.
47+
3848
### Further Reading:
3949
See the [papers](./papers/) folder for two papers showing additional details of the method.
4050

0 commit comments

Comments
 (0)