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

Method get2ClassLinear

JSAT/test/jsat/FixedProblems.java:35–45  ·  view source on GitHub ↗

Generates a linearly separable binary classification problem @param dataSetSize the number of points to generated @param rand the source of randomness @return a binary classification data set that is linearly separable

(int dataSetSize, Random rand)

Source from the content-addressed store, hash-verified

33 * @return a binary classification data set that is linearly separable
34 */
35 public static ClassificationDataSet get2ClassLinear(int dataSetSize, Random rand)
36 {
37 ClassificationDataSet train = new ClassificationDataSet(c2l_m0.length(), new CategoricalData[0], new CategoricalData(2));
38
39 for(Vec s : c2l_c0.sample(dataSetSize, rand))
40 train.addDataPoint(s, new int[0], 0);
41 for(Vec s : c2l_c1.sample(dataSetSize, rand))
42 train.addDataPoint(s, new int[0], 1);
43
44 return train;
45 }
46
47
48 /**

Calls 3

addDataPointMethod · 0.95
sampleMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected