ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
52.99k stars 13.45k forks source link

Can't use XGBoost Classifier with face_recognition #577

Open TheFox3490 opened 6 years ago

TheFox3490 commented 6 years ago

Hello! I saw the using sklearn.Kneighbour classifier with face_recognition example. It works great, but I want to use Classifier from xgboost library to get my face recognition system more accurate.

I tried to modificate some example code to use XGBClassifier, but it generates following WARNINGS and does not recognition anything.

WARNINGS like this: Warning (from warnings module): File "C:\Program Files\Python36\lib\site-packages\sklearn\preprocessing\label.py", line 151 if diff: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use array.size > 0 to check that an array is not empty.

But, original code works well.

I'm attaching my code. Most likely, the problem inside the "predict" function. Please, help me. Sorry for my terrible English, I am Ukrainian.

Link to code: https://pastebin.com/Ceiqr3wN

chemsseddine commented 6 years ago

I think that you can ignore the warning. It is caused by sklearn not by your model ! import warnings warnings.filterwarnings(action='ignore', category=DeprecationWarning)