Skip to content
Snippets Groups Projects
Commit 91048c8c authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

hotfix->kNNscores now handles 1-elements list in the target parameter

parent 1aa24094
No related branches found
No related tags found
6 merge requests!685Release 2.4,!684Release 2.4,!567Release 2.2.1,!566Release 2.2,!501Release 2.1,!400Relase 2.0.1
......@@ -101,8 +101,11 @@ def assignKNNScore(
----------
[1] https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestNeighbors.html
"""
if target in data.columns:
raise ValueError(f"'target' must not exist.")
if isinstance(target, list):
if (len(target) > 1) or (target[0] in data.columns):
raise ValueError(f"'target' must not exist and be of length 1. {target} was passed instead.")
target = target[0]
fields = toSequence(field)
val_frame = data[fields].copy()
score_index = val_frame.index_of("shared")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment