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

Method getMissingDropped

JSAT/src/jsat/DataSet.java:439–453  ·  view source on GitHub ↗

This method returns a dataset that is a subset of this dataset, where only the rows that have no missing values are kept. The new dataset is backed by this dataset. @return a subset of this dataset that has all data points with missing features dropped

()

Source from the content-addressed store, hash-verified

437 * features dropped
438 */
439 public Type getMissingDropped()
440 {
441 List<Integer> hasNoMissing = new IntList();
442 for (int i = 0; i < getSampleSize(); i++)
443 {
444 DataPoint dp = getDataPoint(i);
445 boolean missing = dp.getNumericalValues().countNaNs() > 0;
446 for(int c : dp.getCategoricalValues())
447 if(c < 0)
448 missing = true;
449 if(!missing)
450 hasNoMissing.add(i);
451 }
452 return getSubset(hasNoMissing);
453 }
454
455 /**
456 * Splits the dataset randomly into proportionally sized partitions.

Callers

nothing calls this directly

Calls 7

getSampleSizeMethod · 0.95
getDataPointMethod · 0.95
getNumericalValuesMethod · 0.95
getCategoricalValuesMethod · 0.95
addMethod · 0.95
getSubsetMethod · 0.95
countNaNsMethod · 0.80

Tested by

no test coverage detected