MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / sample

Method sample

JSAT/src/jsat/distributions/multivariate/NormalM.java:209–224  ·  view source on GitHub ↗
(int count, Random rand)

Source from the content-addressed store, hash-verified

207 }
208
209 public List<Vec> sample(int count, Random rand)
210 {
211 List<Vec> samples = new ArrayList<Vec>(count);
212 Vec Z = new DenseVector(L.rows());
213
214 for(int i = 0; i < count; i++)
215 {
216 for(int j = 0; j < Z.length(); j++)
217 Z.set(j, rand.nextGaussian());
218 Vec sample = L.multiply(Z);
219 sample.mutableAdd(mean);
220 samples.add(sample);
221 }
222
223 return samples;
224 }
225}

Callers 8

get2ClassLinear2DMethod · 0.95
testDist_Vec_VecMethod · 0.95
testDist_Vec_VecMethod · 0.95
setUpMethod · 0.95
testTransformMethod · 0.95
testTransformMethod · 0.95

Calls 6

lengthMethod · 0.95
setMethod · 0.95
mutableAddMethod · 0.95
rowsMethod · 0.45
multiplyMethod · 0.45
addMethod · 0.45

Tested by 8

get2ClassLinear2DMethod · 0.76
testDist_Vec_VecMethod · 0.76
testDist_Vec_VecMethod · 0.76
setUpMethod · 0.76
testTransformMethod · 0.76
testTransformMethod · 0.76