Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when impostors list is empty #17

Closed
varunagrawal opened this issue Apr 2, 2016 · 6 comments · Fixed by #36
Closed

Error when impostors list is empty #17

varunagrawal opened this issue Apr 2, 2016 · 6 comments · Fixed by #36
Labels
Milestone

Comments

@varunagrawal
Copy link

Numpy throws an error in np.hstack(impostors) when impostors is empty.
What would be the recommended way to fix this?

@perimosocordiae
Copy link
Contributor

If the impostors list is empty, the rest of the algorithm doesn't make much sense to run. That being said, the code should handle that case more gracefully. A simple check before calling hstack could avoid the error, but the main fit() function should handle the lack of impostors in some way as well.

@varunagrawal
Copy link
Author

Exactly! If a particular dataset happens to provide no impostors, shouldn't the code just display the appropriate nearest neighbors?

@varunagrawal
Copy link
Author

Hi,
Still waiting for a suggestion on the fix. I can work on the PR once I get the suggestion.

@perimosocordiae
Copy link
Contributor

Sorry for the late response. In the fit method, we could check the size of impostors and raise a warning if it's empty. At that point, it probably makes sense to return early.

@perimosocordiae perimosocordiae added this to the v0.3 milestone Jun 20, 2016
@anirudt
Copy link
Contributor

anirudt commented Sep 28, 2016

@perimosocordiae : Return early with the linear transformation as an identity matrix, i.e. do nothing, right?

@perimosocordiae
Copy link
Contributor

Yep, that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants