Skip to content

yongbin999/Python-predictive-model

Repository files navigation

Python-predictive-model

using google predictive model API and output prediction with python script
http://sunlit-pipe-95822.appspot.com/
deployed with google appcfg to appspot
todos future - front end view, sample data view, load file system for new queries

Traning Docs


-sample training on language prediction api

https://cloud.google.com/prediction/docs/hello_world

-try out the cloud predictive spreadsheet

https://docs.google.com/spreadsheet/ccc?key=0AisEGDqMba8MdFlMSmcyaXBfT1dUN1dPLTZXNUd3WUE#gid=7

-try out the hosted models examples

projectnumber:414649711441
model:sample.languageid
https://developers.google.com/apis-explorer/?hl=en_US#p/prediction/v1.6/prediction.hostedmodels.predict

-clone and modified to work with clientid/secret

https://github.com/GoogleCloudPlatform/prediction-try-java-python


figured out flow in OAuth2.0 to allow request access
once have access stored in backend, then you can make requests

my python script: main.py


usage:
  • script: use the ./run.py to skip the manual step
  • manual: while inside the folder and hav google_appengine at home directory, in terminal run
    ~/google_appengine/dev_appserver.py ./
    open browser at http://localhost:8080
  • it would ask to auth access for OAuth2 for the first time
  • click accpet and it would query and display results
  • to add/modify the query prediction, change the query.csv

  • file description:

  • run.py - script to start server and browser
  • main.py - codes for server and query
  • data_io.py - codes for processing csv query
  • access.py - variable for accessing models in google prediction api
  • dataset sat scores- https://catalog.data.gov/dataset/sat-results-e88d7


    functional design:

  • routes setup at the bottom
  • on default /, directs to MainPage
  • if credential doesnt exist, opens up flow in OAuth and redirects to AuthHandler
    AuthHandler checks if credential exists, if so returns to main
  • if credential already done, then process those the query for each row in query.csv
  • About

    using google predictive model API and output prediction with python script

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published