mirror of
https://github.com/sjwhitworth/golearn.git
synced 2025-04-28 13:48:56 +08:00
Update knn.go to allow all FloatAttributes.
This commit is contained in:
parent
353cd38e7c
commit
bce1f15444
@ -124,6 +124,12 @@ func (KNN *KNNClassifier) Predict(what base.FixedDataGrid) base.FixedDataGrid {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If every Attribute is a FloatAttribute, then we remove the last one
|
||||||
|
// because that is the Attribute we are trying to predict.
|
||||||
|
if len(allNumericAttrs) == len(allAttrs) {
|
||||||
|
allNumericAttrs = allNumericAttrs[:len(allNumericAttrs)-1]
|
||||||
|
}
|
||||||
|
|
||||||
// Generate return vector
|
// Generate return vector
|
||||||
ret := base.GeneratePredictionVector(what)
|
ret := base.GeneratePredictionVector(what)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user