Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance and accuracy issues with Loess regression #29

Closed
piever opened this issue Apr 18, 2019 · 2 comments
Closed

Performance and accuracy issues with Loess regression #29

piever opened this issue Apr 18, 2019 · 2 comments

Comments

@piever
Copy link

piever commented Apr 18, 2019

I'm comparing Loess with the Loess.jl package and results differ a bit. Steps to reproduce:

import DataInterpolations, Loess

t = sort(10 .* rand(100));
u = sin.(t) .+ 0.5 * randn(100);
l1 = DataInterpolations.Loess(u, t, 2, 0.75);
l2 = Loess.loess(t, u, degree=2, span=0.75);

using Plots
scatter(t, u, label="")
plot!(t, l1.(t), label="DataInterpolations.Loess")
plot!(t, Loess.predict(l2, t), label="Loess.loess")

Screenshot from 2019-04-18 18-22-18

Concerning performance, it's a bit puzzling as fitting here is much faster than Loess.jl and prediction is much slower:

julia> using BenchmarkTools

julia> @btime DataInterpolations.Loess($u, $t, 2, 0.75);
  1.706 μs (4 allocations: 4.31 KiB)

julia> @btime Loess.loess($t, $u, degree=2, span=0.75);
  4.058 ms (77694 allocations: 3.82 MiB)

But performance on the prediction degrades when the data is a bit bigger:

julia> t = sort(10 .* rand(1000));

julia> u = sin.(t) .+ 0.5 * randn(1000);

julia> l1 = DataInterpolations.Loess(u, t, 2, 0.75);

julia> l2 = Loess.loess(t, u, degree=2, span=0.75);

julia> @btime $l1.($t);
  43.769 ms (17003 allocations: 94.37 MiB)

julia> @btime Loess.predict($l2, $t);
  4.545 ms (48492 allocations: 1.48 MiB)
@sipah00
Copy link
Contributor

sipah00 commented Apr 19, 2019

@piever Thanks for reporting this, Right now, I'm having my final exams, will look into it after some days.

@ChrisRackauckas
Copy link
Member

LOESS was removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants