Julia Programming Language
How to return the value and the weight of sampled element?
General Usage
indexing
Skoffer
April 4, 2020, 7:40am
4
Less memory intensive version could be
idx = sample(Weights(weights)) (values[idx], weights[idx])
3 Likes
show post in topic
Related topics
Topic
Replies
Views
Activity
log(N) algo for sampling from vector
Performance
5
920
February 7, 2018
Weighted sampling algorithms not yet shipped?
General Usage
question
,
statistics
1
322
October 2, 2021
MethodError: no method matching Weights(::Array{Any,1}, ::Float64)
General Usage
question
,
array
,
type
0
290
June 8, 2021
Using Weights from statsbase in Julia, and using an array
New to Julia
package
2
2929
November 27, 2020
StatsBase sample throws first element when probabilities are zero
General Usage
question
2
320
September 3, 2022