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

Method writePoint

JSAT/src/jsat/io/DataWriter.java:98–108  ·  view source on GitHub ↗

Write out the given data point to the output stream @param dp the data point to write to the file @param label The associated label for this dataum. If #type is a DataSetType#SIMPLE set, this value will be ignored. If DataSetType#CLASSIFICATION, the value will be assumed to b

(DataPoint dp, double label)

Source from the content-addressed store, hash-verified

96 * integer class label.
97 */
98 public void writePoint(DataPoint dp, double label) throws IOException
99 {
100 ByteArrayOutputStream baos = local_baos.get();
101 pointToBytes(dp, label, baos);
102 if(baos.size() >= LOCAL_BUFFER_SIZE)//We've got a big chunk of data, lets dump it
103 synchronized(out)
104 {
105 baos.writeTo(out);
106 baos.reset();
107 }
108 }
109
110 /**
111 * This method converts a datapoint into the sequence of bytes used by the underlying file format.

Callers 3

testWriteReadMethod · 0.95
testLoadR_FileMethod · 0.95
writeDataMethod · 0.95

Calls 4

pointToBytesMethod · 0.95
resetMethod · 0.80
sizeMethod · 0.65
getMethod · 0.45

Tested by 2

testWriteReadMethod · 0.76
testLoadR_FileMethod · 0.76