zhengruifeng and dongjoon-hyun [SPARK-38775][ML] cleanup validation functions
27ed89b Jun 19, 2022
[SPARK-38775][ML] cleanup validation functions
### What changes were proposed in this pull request?
1, remove unused `extractInstances` and `extractLabeledPoints` in `Predictor`;
2, remove unused `checkNonNegativeWeight` in `function`;
3, move `getNumClasses` from `Clasifier` to `DatasetUtils`;
4, move `getNumFeatures` from `MetadataUtils` to `DatasetUtils`;

### Why are the changes needed?
to unify to methods

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
existing testsuites

Closes #36049 from zhengruifeng/validate_cleanup.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
27ed89b