kootenpv / whereami

Uses WiFi signals :signal_strength: and machine learning to predict where you are
GNU Affero General Public License v3.0
5.1k stars 247 forks source link

ValueError: Sample sequence X is empty #22

Closed drakmail closed 7 years ago

drakmail commented 7 years ago

I'm tried to run whereami learn -l test_location -n 100 and get following error:

➜  test git:(master) ✗ whereami learn -l test_location -n 100
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:01<00:00, 53.30it/s]
Traceback (most recent call last):
  File "/usr/local/bin/whereami", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/site-packages/whereami/__main__.py", line 39, in main
    learn(args.location, args.num_samples)
  File "/usr/local/lib/python3.5/site-packages/whereami/learn.py", line 27, in learn
    train_model()
  File "/usr/local/lib/python3.5/site-packages/whereami/pipeline.py", line 27, in train_model
    lp.fit(X, y)
  File "/usr/local/lib/python3.5/site-packages/sklearn/pipeline.py", line 268, in fit
    Xt, fit_params = self._fit(X, y, **fit_params)
  File "/usr/local/lib/python3.5/site-packages/sklearn/pipeline.py", line 234, in _fit
    Xt = transform.fit_transform(Xt, y, **fit_params_steps[name])
  File "/usr/local/lib/python3.5/site-packages/sklearn/feature_extraction/dict_vectorizer.py", line 231, in fit_transform
    return self._transform(X, fitting=True)
  File "/usr/local/lib/python3.5/site-packages/sklearn/feature_extraction/dict_vectorizer.py", line 184, in _transform
    raise ValueError("Sample sequence X is empty.")
ValueError: Sample sequence X is empty.

OS version: macOS 10.12.1 Python version: 3.5.2

kootenpv commented 7 years ago

I am assuming that there were no access points nearby? I tried to add a check for this in the code. Are you sure your wifi was switched on? (just checking)

drakmail commented 7 years ago

Yes, I was connected to wifi AP and there was several (about 15) another access points

drakmail commented 7 years ago

Hm, seems that I found reason - I'm was turned on WiFi hotspot. It perfect work with wifi hotspot turned off

kootenpv commented 7 years ago

@drakmail thanks for the update! Glad it was resolved.