GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python-machine-learning-book-3rd-edition/ch09 at master · rasbt/python-machine-learning-book-3rd-edition

Expand file tree

/

ch09

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

ch09

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
1st_flask_app_1
1st_flask_app_1
 
 
1st_flask_app_2
1st_flask_app_2
 
 
images
images
 
 
movieclassifier
movieclassifier
 
 
movieclassifier_with_update
movieclassifier_with_update
 
 
pickle-test-scripts
pickle-test-scripts
 
 
README.md
README.md
 
 
ch09.ipynb
ch09.ipynb
 
 
movie_data.csv.gz
movie_data.csv.gz
 
 

README.md

Sebastian Raschka, 2017

Python Machine Learning - Code Examples

Chapter 9 - Embedding a Machine Learning Model into a Web Application

  • Serializing fitted scikit-learn estimators
  • Setting up a SQLite database for data storage
  • Developing a web application with Flask
  • Our first Flask web application
    • Form validation and rendering
    • Turning the movie classifier into a web application
  • Deploying the web application to a public server
    • Updating the movie review classifier
  • Summary

The code for the Flask web applications can be found in the following directories:

  • 1st_flask_app_1/: A simple Flask web app
  • 1st_flask_app_2/: 1st_flask_app_1 extended with flexible form validation and rendering
  • movieclassifier/: The movie classifier embedded in a web application
  • movieclassifier_with_update/: same as movieclassifier but with update from sqlite database upon start

To run the web applications locally, cd into the respective directory (as listed above) and execute the main-application script, for example,

cd ./1st_flask_app_1
python3 app.py

Now, you should see something like

 * Running on http://127.0.0.1:5000/
 * Restarting with reloader

in your terminal. Next, open a web browser and enter the address displayed in your terminal (typically http://127.0.0.1:5000/) to view the web application.

Link to a live example application built with this tutorial: http://raschkas.pythonanywhere.com/.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.