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)
| 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. |