Abhishek
Abhishek

Reputation: 3417

scikit learn on google cloud platform through datalab or compute engine?

I am running a Django App inside GCP. My idea was to call a python script from "view.py" for some machine learning algorithm and then display the result on the page.

But now I understand that running a machine learning library like Scikit-learn on GAE will not be possible (read Tim's answer here and this thread).

But suppose I need to still do this, I believe there are 2 ways possible, but I am not sure weather my guess is right or wrong

1) As the Google-Datalab provides the entire anaconda like distribution, if we have any datalab api which can be called from a python file in the Django app, I can achieve my goal ?

2) If I can install the scikit-learn library on any compute engine on GCP and somehow send it the request to run my code and then return the output back to the python file in the Django app ?

I am very new to client-server and cloud computing on the whole, so please provide examples (if possible) for any suggestion/ pointer for the help.

Regards,

Upvotes: 0

Views: 635

Answers (2)

Lak
Lak

Reputation: 4166

sklearn is now supported on ML Engine.

So, another alternative now is to use online prediction on Cloud ML Engine, and deploy your scikit-learn model as a web service.

Here is a fully worked out example of using fully-managed scikit-learn training, online prediction and hyperparameter tuning:

https://github.com/GoogleCloudPlatform/training-data-analyst/blob/master/blogs/sklearn/babyweight_skl.ipynb

Upvotes: 0

Omar Jarjur
Omar Jarjur

Reputation: 1066

I believe what you want is to use the App Engine Flex environment rather than the standard App Engine environment.

App Engine Flex uses a compute engine VM for running your code, so it does not have the library limitations that standard App Engine has.

Specifically, you'll need to add a 'requirements.txt' file to specify the version of scikit-learn that you want installed, and then add a 'vm: true' clause to your app.yaml file.

Upvotes: 2

Related Questions