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

How can I tell if I'm in an unknown location? #31

Open JesseTG opened 7 years ago

JesseTG commented 7 years ago

I think that this app should consider the case where the machine is in an unfamiliar location. Is that feature available?

kionay commented 7 years ago

If I'm not mistaken, unknown values when working with properly learned data is just when the confidence of every location is low.

That is to say, I think "unknown location" is equivalent to "the confidence for all other locations is below a threshold" what that threshold would be I have no idea.

kootenpv commented 7 years ago

@kionay Usually, the probabilities across classes would add up to 1. That means that even if you are at an unknown place, there has to be a probability of 1.... It's annoying about machine learning.

In fact, you might normally think that if the probabilities are all too close to each other, then that might actually indicate it is an unknown place.

Unfortunately, there is no definite way to consider what is an unknown location. It is in fact completely arbitrary from the classifier's perspective.

Only on the level of completely different buildings (when there are no known access points available), then you could build in a rule that you are most likely certain you are at an unknown location. In a smaller area though, with overlapping access points, it is certainly not straightforward to implement "unknown location".

Is there a use case you have in mind?

The simplest case that could be implemented is checking whether the input contains only unknown wifis....

In the end, I think it only makes sense to implement this when we have use case, since there is not one obvious way to do it :)

JesseTG commented 7 years ago

@kootenpv I have problems thinking of use cases in general, so no, I do not. But I like the idea and accessibility of this project too much to just ignore it.

Maybe at a minimum it could remind you to record data (or do so itself with some daemon) if you're somewhere new?

fedekau commented 7 years ago

Maybe this problem can be solved applying some of the techniques described in scikit-lean outlier detection

kootenpv commented 7 years ago

@fedekau Outlier detection will not help decide what the definition is of an unknown location.

Give these a thought:

There is no automated way to detect these changes unless you have a particular case in mind.

fedekau commented 7 years ago

@kootenpv Yeah you're right.

The phrase unless you have a particular case made me think, maybe a "solution" could be having an interface that the user can implement that tells the program how to define "unknow" for the specific use case they need.

By the way, awesome library 😎

kootenpv commented 7 years ago

@fedekau Thanks! Yea, you also made me rethink it like that.... But solving that right now is trying to come up with a solution without a real problem ^^

kootenpv commented 7 years ago

Ok, this is pretty embarrassing!

Indeed... I think a very safe default would be to just consider an extra class "unknown" with one line containing {} as features:

unknown.txt

{}

Since class balancing is used, it should work really well. I added the "unknown.txt" to my data, and it seems to work.

I guess it could simply be added in a flag for training; whether it should create the unknown.txt file, or, otherwise delete if existing.

fedekau commented 7 years ago

Awesome! I will try it 😎

vansh215 commented 7 years ago

whereami learn -l bedroom -l 100 when i execute this command the error i get is Can't write PID file to /var/run/whereami.started.719 at /usr/sbin/whereami line 229. can anyone explain asap

kootenpv commented 7 years ago

@vansh215 can you make sure that the whereami you use is from python? on the command line: whereis whereami

vansh215 commented 7 years ago

whereami: /usr/sbin/whereami /etc/whereami /usr/share/whereami /usr/share/man/man8/whereami.8.gz

sir,this is the output

kootenpv commented 7 years ago

@vansh215 that's not my python package, I think there's one linux distro that includes another whereami already.

You could instead try running like:

python -m whereami learn -l bedroom    # default python
python3 -m whereami learn -l bedroom   # python 3, whichever you have installed