Web2py and machine learning - scikit-learn

163 views
Skip to first unread message

GIsaac

unread,
Nov 14, 2017, 12:57:25 AM11/14/17
to web2py-users
Hi all,

I'm doing a project which will be based around web frameworks and adaptivity using machine learning, and have been looking into the possibility of using web2py.

Is it possible to import/use the Scikit-learn library with web2py? Has anyone here done this? 
I understand that it is possible to import other python libraries into web2py, however haven't seen any examples of people doing this with scikit specifically.

Many thanks for any help that can be given.

Massimo Di Pierro

unread,
Nov 14, 2017, 2:43:14 PM11/14/17
to web2py-users
I have. Works fine. 
You can import any python library in web2py as long as it is installed.
You can have issues with libraries that are not thread safe and if they are, you will have to lock when using them.
I do not know for sure which algos in scikit learn are thread safe and which ones are not. You have to check that.

Massimo

Pierre

unread,
Nov 15, 2017, 8:52:45 AM11/15/17
to web2py-users
Is there a reliable way to determine whether or not a library is thread-safe ?

what's the web2py method for locking ?    (module: thread/threading ? what kind of lock with what option: blocking/non-blocking) ?)

thanks




Pierre

unread,
Nov 17, 2017, 4:16:27 PM11/17/17
to web2py-users
found this related to locking :
https://redis.io/topics/distlock
topic is very hermetic so if someone successfully implemented a lock in the production context of a web application i would really appreciate he shares his esoteric knowledge with us: 'the ignorants'

GIsaac

unread,
Nov 19, 2017, 8:51:43 AM11/19/17
to web2py-users
Thanks for your response!

I've imported the libraries I was planning on using, however I noticed that Matplotlib doesn't seem to want to play nicely with Web2Py. 
If I try to produce a plot of my data set and open the web app, Web2Py will stop responding.
Is this a known issue? Perhaps I have implemented it incorrectly.

G

Leonel Câmara

unread,
Nov 19, 2017, 5:57:04 PM11/19/17
to web2py-users
Depending on how you use matplotlib you may need to surround your calls with a lock section.
Reply all
Reply to author
Forward
0 new messages