PyCon 2016 in Portland, Or
hills next to breadcrumb illustration

Web Apps that Learn: An Architecture for Machine Learning in Django

Benjamin Bengfort, Rebecca Bilbro

Audience level:
Intermediate
Category:
Web Frameworks

Description

Web applications are becoming smarter and more personalized through the clever use of automatic optimization and machine learning algorithms. We present a standard architecture for Django web apps that utilize models trained via Scikit-Learn to tune experiences for specific users. By utilizing familiar tools, this architecture allows for reinforcing models that integrate directly with web apps.

Abstract

Web applications are becoming smarter and more personalized through the clever use of automatic optimization and machine learning algorithms. In this poster, we present a standard architecture for Django web applications that utilizes models trained via Scikit-Learn to predict and tune experiences for specific users. Web application developers will discover that the tools they currently use like Django, REST Frameworks, and PostgreSQL are also the framework required for online machine learning. Data scientists will discover that a web platform is ideal for reinforcing models through feedback, employing ensemble techniques, and deciding when to retrain models. Machine learning algorithms differ from traditional data mining in that they utilize pattern recognition techniques from historical data to learn how to identify or predict outcomes for new information. As the algorithm makes predictions, feedback is utilized to adapt or correct the model so that it learns from new experience as well as the old. This makes web and mobile applications an ideal place to employ or deploy machine learned models. As users interact with your application, they train models that can then be used to tune the experience for new users or to personalize content for existing users. Machine learning methods have two phases: a training/validation phase and an operational phase. For this reason, traditional web architectures that employ an application server and backend database need to be adapted to fit into the ML lifecycle. In this poster we present a machine learning architecture for directly using models inside of web applications, particularly via a RESTful API.