-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Plotting methods #38
Comments
👍 Cool... this is certainly the type of thing I was thinking of. It would also be great to add some "plotting recipes" that work with various stats. For example, it would be really cool to be able to do a pca/svd on a scatter plot and add overlays like the image from wikipedia: |
I was just peaking through your plotmethods code... what do you think about adding a Function keyword arg
The advantage here is that you can use the same Although, I think this interface could be cleaned up further, so maybe add a new method with this functionality for now? |
Since my end goal was making plots, I like this idea.
|
What about something like this? It updates an OnlineStat (with all of I think it could replace function update_do!(o::OnlineStat, data...;
b::Integer = size(data[1], 1),
dothis::Function = x -> nothing,
batch::Bool = false
)
b = @compat Int(b)
n = size(data[1], 1)
i = 1
while i <= n
rng = i:min(i + b - 1, n)
batch_data = map(x -> rows(x, rng), data)
batch ? updatebatch!(o, batch_data...) : update!(o, batch_data...)
i += b
dothis(o)
end
end julia> o = OnlineStats.Mean();
julia> OnlineStats.update_do!(o, randn(100), b = 50, dothis = o -> println(nobs(o)))
50
100 |
I certainly like it more as part of the core update function, but would argue that having both Here's a possible abstraction for callbacks. designed as functors:
Then a rough draft for altering the method, assuming we can add a parameter which defines whether a stat should update batch or not:
|
It would be nice to extend I'm worried that OnlineCallback/BatchMode is too elegant. With a few small changes to Do we just need a more general |
It's always bugged me that there are different verbs for batch update vs singleton updates. Singleton updates are just a batch size of 1, no? I mostly agree with you about fit vs update. I'm just trying to reconcile the verbs here with the ones that may come out of JuliaML/LossFunctions.jl#3. I really want to be able to chain these things together into a pipeline, and having different verbs (which mean essentially the same thing) will ruin that. Maybe the primary verb there should be
Any anyone can choose the one that feels natural to them. Although maybe we should actually reference any verbs from StatsBase instead. |
Personally I dislike But from a community perspective I think that it's probably best if we just adopt the language standard of Julia. Using synonyms seems like an ugly solution and just makes the code less readable for outsiders. Let's not make it more complicated than it needs to be and just use |
Thanks for the link! A unified framework is enough to sell me on |
Great to have you on board. There is a lot to learn from your package and I think we are at a good point in time to attempt such a design coordination. I think combined we cover enough of a scope so that others would likely follow (provided we succeed in this endeavour which I am confident about) |
#42 is relevant. All plotting methods should go in the plots.jl file which gets included with Requires. |
Continued from JuliaPlots/Plots.jl#30
Since Plots.jl exists, we can now implement plotting methods with less worry about a user's preferred plotting package.
In the josh branch, I currently have a new
traceplot!(o, b, data...; f)
function which plots the valuex = nobs(o)
y = f(o)
for everyb
observations.f
defaults tov -> state(v)[1]
, but any function that works on the OnlineStat and returns a Real scalar or Vector should work.Edit for example:
The text was updated successfully, but these errors were encountered: