fslaborg / FSharp.Stats

statistical testing, linear algebra, machine learning, fitting and signal processing in F#
https://fslab.org/FSharp.Stats/
Other
205 stars 54 forks source link

Move regularize anywhere more appropriate #285

Open bvenn opened 11 months ago

bvenn commented 11 months ago

The regularizeValues function is located in Interpolation.Approximation. While it is currently only used here, it is of bread interest to have this function available on a more global layer. It could be moved to the Seq/List/Array/Vector modules, or to its own source file in the Signal namespace.

Function

Zipping, sorting, aggregating at ties

let xData = [2;2;1;3]
let yData = [8;9;1;4]

regularizeValues xData yData Seq.mean
val it: seq<float * float> = seq [(1.0, 1.0); (2.0, 8.5); (3.0, 4.0)]