Hello,

I was wondering whether anyone knows of a package/function that approximates a function with a step function. As an example, below in blue is the data I am trying to approximate, in red is my wanted output (a step function).

Hello,

I was wondering whether anyone knows of a package/function that approximates a function with a step function. As an example, below in blue is the data I am trying to approximate, in red is my wanted output (a step function).

3 Likes

I think you want a simple regression tree. The number of â€śstepsâ€ť is equal to the number of leavesâ€¦ MLJ.jl gives access to various options.