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

Method finishAdding

JSAT/src/jsat/text/TextDataLoader.java:274–299  ·  view source on GitHub ↗

Once all original documents have been added, this method is called so that post processing steps can be applied.

()

Source from the content-addressed store, hash-verified

272 * that post processing steps can be applied.
273 */
274 protected void finishAdding()
275 {
276 noMoreAdding = true;
277
278 workSpace = null;
279 storageSpace = null;
280 wordCounts = null;
281
282 int finalLength = currentLength.get();
283 int[] frqs = new int[finalLength];
284 for(Map.Entry<Integer, AtomicInteger> entry : termDocumentFrequencys.entrySet())
285 frqs[entry.getKey()] = entry.getValue().get();
286 for(SparseVector vec : vectors)
287 {
288 //Make sure all the vectors have the same length
289 vec.setLength(finalLength);
290 }
291 weighting.setWeight(vectors, IntList.view(frqs, finalLength));
292
293 System.out.println("Final Length: " + finalLength);
294 for(SparseVector vec : vectors)
295 {
296 //Unlike normal index functions, WordWeighting needs to use the vector to do some set up first
297 weighting.applyTo(vec);
298 }
299 }
300
301 /**
302 * Returns a new data set containing the original data points that were

Callers 3

getDataSetMethod · 0.95
getDataSetMethod · 0.45
getDataSetMethod · 0.45

Calls 8

viewMethod · 0.95
getMethod · 0.45
entrySetMethod · 0.45
getKeyMethod · 0.45
getValueMethod · 0.45
setLengthMethod · 0.45
setWeightMethod · 0.45
applyToMethod · 0.45

Tested by

no test coverage detected