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

[Enhancement] REST API to get all configured locations? #147

Open
kiwiandroiddev opened this issue Feb 13, 2017 · 8 comments
Open

[Enhancement] REST API to get all configured locations? #147

kiwiandroiddev opened this issue Feb 13, 2017 · 8 comments

Comments

@kiwiandroiddev
Copy link

Hi,

I wondered if there could be a new API for retrieving the list of all configured locations for a group on a server?

Something like GET /locations?group=my_group that returns:

{
   "message":"Correctly found locations.",
   "success":true,
   "locations":["bed bath", "bedroom", "car", "dining"]
}

It seems that this data can be obtained by appropriating the existing /location call for some known user, but not without getting a lot of extra irrelevant data too (signal strengths) which isn't ideal for mobile clients.

@kiwiandroiddev kiwiandroiddev changed the title REST API to get all configured locations? Feb 13, 2017
@schollz
Copy link
Owner

schollz commented Feb 14, 2017

Your right, I avoided this since I figured folks would do as you suggest. I can certainly add, it's easy. Ill put it up later this week!

@TilBlechschmidt
Copy link

It would also be great if the location array could contain some metadata like the amount of stored fingerprints for each location.

@schollz
Copy link
Owner

schollz commented Feb 16, 2017

@TheMegaTB @kiwiandroiddev

I've added it now, see if this will work for you: https://www.internalpositioning.com/api/#get-locations

It's live now, but I can still make modifications.

@TilBlechschmidt
Copy link

Just out of curiosity, how is the accuracy calculated?
(I want to display some kind of progress bar for learning and am searching for the best way to do it)

@TilBlechschmidt
Copy link

@schollz thanks for the quick implementation of that feature! One more thing that prevents it from being used though is the missing Cross-Origin resource sharing header. Please have a look at #148 for the details.

@schollz
Copy link
Owner

schollz commented Feb 16, 2017

@TheMegaTB The accuracy is calculated for the Naive Bayes implementation - it uses cross validation against a sequestered test set against the set used for learning. Its useful for figuring out which places aren't learned well.

@TilBlechschmidt
Copy link

TilBlechschmidt commented Feb 16, 2017

It should be noted that newly learned locations are not returned by /locations right after learning and instead it requires a call to the /calculate endpoint for the location to show up.

@schollz
Copy link
Owner

schollz commented Feb 16, 2017

Thanks, I updated the docs with that note

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