m3g / easyfit.jl Goto Github PK
View Code? Open in Web Editor NEWEasy interface for obtaining fits for 2D data
License: MIT License
Easy interface for obtaining fits for 2D data
License: MIT License
I merged the PR and did some code refactoring. But the polynomial fits do not seem to be working. I currently have no time to debug it, but it seems to be something related to how the model is being built. I would suggests following the same structure as the multi-exponential functions.
The tests are now in the end of the corresponding file of each type of fit. You can run them as usual, but also individually if using VScode.
Current Julia versions (1.8) often build dependency trees requiring Interpolations.jl v0.14
and newer.
Would be nice to add this and trigger a release. The commands that I use (like movavg
) seem wo work also with the newer Interpolations.jl
version, however I did not check every function.
PS: If you're lazy I opened a PR :-)
Neat package! Not sure if you have plans for future developments, but one thing that would be nice to have is the ability to predict from the fitted object, e.g.:
function (fit::EasyFit.Cubic)(x::Real)
a = fit.a
b = fit.b
c = fit.c
d = fit.d
return a * x^3 + b * x^2 + c * x + d
end
Then you can just call it on new data:
julia> x = sort(rand(10)); y = x.^3 .+ rand(10);
julia> f = fitcubic(x,y)
------------------- Cubic Fit -----------------
Equation: y = ax^3 + bx^2 + cx + d
With: a = 3.498571133673037
b = -5.75292789995513
c = 2.626129810011887
d = 0.6361773562878126
Pearson correlation coefficient, R = 0.7405690253097572
Average square residue = 0.01215483592609077
Predicted Y: ypred = [0.6416314330095221, 0.6417874373639705...
residues = [-0.13182717628179608, -0.01592993507117535...
-----------------------------------------------
julia> f.(rand(10))
10-element Vector{Float64}:
0.8761239348448231
0.9115358893542463
0.9121562305431836
0.8919530945018805
⋮
0.81693749334824
0.9622975666245418
0.9753695182250022
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.