fun checkInstance(instance: Instance): Boolean { if (instance.numAttributes() !== numAttributes()) { return false } for (i in 0 until numAttributes()) { if (instance.isMissing(i)) { continue } else if (attribute(i).isNominal() || attribute(i).isString()) { if (!Utils.eq(instance.value(i), instance.value(i) as Int.toDouble())) { return false } else if (Utils.sm(instance.value(i), 0) || Utils.gr( instance.value(i), attribute(i).numValues() ) ) { return false } } } return true }
Checks if the given instance is compatible with this dataset . Only looks at the size of the instance and the ranges of the values for nominal and string attributes .