@return the number of missing values in both numeric and categorical features
()
| 604 | * @return the number of missing values in both numeric and categorical features |
| 605 | */ |
| 606 | public long countMissingValues() |
| 607 | { |
| 608 | long missing = 0; |
| 609 | for (int i = 0; i < getSampleSize(); i++) |
| 610 | { |
| 611 | DataPoint dp = getDataPoint(i); |
| 612 | missing += dp.getNumericalValues().countNaNs(); |
| 613 | for(int c : dp.getCategoricalValues()) |
| 614 | if(c < 0) |
| 615 | missing++; |
| 616 | } |
| 617 | return missing; |
| 618 | } |
| 619 | |
| 620 | /** |
| 621 | * Creates an array of column vectors for every numeric variable in this |