Getting Started with Streamlit for Data Science
eBook - ePub

Getting Started with Streamlit for Data Science

Tyler Richards

Share book
  1. 282 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Getting Started with Streamlit for Data Science

Tyler Richards

Book details
Book preview
Table of contents
Citations

About This Book

Create, deploy, and test your Python applications, analyses, and models with ease using Streamlit

Key Features

  • Learn how to showcase machine learning models in a Streamlit application effectively and efficiently
  • Become an expert Streamlit creator by getting hands-on with complex application creation
  • Discover how Streamlit enables you to create and deploy apps effortlessly

Book Description

Streamlit shortens the development time for the creation of data-focused web applications, allowing data scientists to create web app prototypes using Python in hours instead of days. Getting Started with Streamlit for Data Science takes a hands-on approach to helping you learn the tips and tricks that will have you up and running with Streamlit in no time.You'll start with the fundamentals of Streamlit by creating a basic app and gradually build on the foundation by producing high-quality graphics with data visualization and testing machine learning models. As you advance through the chapters, you'll walk through practical examples of both personal data projects and work-related data-focused web applications, and get to grips with more challenging topics such as using Streamlit Components, beautifying your apps, and quick deployment of your new apps.By the end of this book, you'll be able to create dynamic web apps in Streamlit quickly and effortlessly using the power of Python.

What you will learn

  • Set up your first development environment and create a basic Streamlit app from scratch
  • Explore methods for uploading, downloading, and manipulating data in Streamlit apps
  • Create dynamic visualizations in Streamlit using built-in and imported Python libraries
  • Discover strategies for creating and deploying machine learning models in Streamlit
  • Use Streamlit sharing for one-click deployment
  • Beautify Streamlit apps using themes, Streamlit Components, and Streamlit sidebar
  • Implement best practices for prototyping your data science work with Streamlit

Who this book is for

This book is for data scientists and machine learning enthusiasts who want to create web apps using Streamlit. Whether you're a junior data scientist looking to deploy your first machine learning project in Python to improve your resume or a senior data scientist who wants to use Streamlit to make convincing and dynamic data analyses, this book will help you get there! Prior knowledge of Python programming will assist with understanding the concepts covered.

]]>

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Getting Started with Streamlit for Data Science an online PDF/ePUB?
Yes, you can access Getting Started with Streamlit for Data Science by Tyler Richards in PDF and/or ePUB format, as well as other popular books in Computer Science & Data Processing. We have over one million books available in our catalogue for you to explore.

Information

Year
2021
ISBN
9781800563209

Section 1: Creating Basic Streamlit Applications

This section will introduce you to the basics of Streamlit applications, data visualization in Streamlit, how to deploy applications, and how to implement models in a Streamlit application.
The following chapters are covered in this section:
  • Chapter 1, An Introduction to Streamlit
  • Chapter 2, Uploading, Downloading, and Manipulating Data
  • Chapter 3, Data Visualization
  • Chapter 4, Using Machine Learning with Streamlit
  • Chapter 5, Deploying Streamlit with Streamlit Sharing

Chapter 1: An Introduction to Streamlit

Streamlit is a web application framework that helps you build and develop Python-based web applications that can be used to share analytics results, build complex interactive experiences, and illustrate new machine learning models. On top of that, developing and deploying Streamlit apps is incredibly fast and flexible, often turning application development time from days into hours.
In this chapter, we start out with the Streamlit basics. We will learn how to download and run demo Streamlit apps, how to edit demo apps using our own text editor, how to organize our Streamlit apps, and finally, how to make our very own. Then, we will explore the basics of data visualization in Streamlit. We will learn how to accept some initial user input, and then add some finishing touches to our own apps with text. At the end of this chapter, you should be comfortable starting to make your own Streamlit applications!
In particular, we will cover the following topics:
  • Why Streamlit?
  • Installing Streamlit
  • Organizing Streamlit apps
  • Streamlit plotting demo
  • Making an app from scratch
Before we begin, we will start with the technical requirements to make sure we have everything we need to get started.

Technical requirements

Here are the installations and setup required for this chapter:
  • The requirements for this book are to have Python 3.7 (or later) downloaded (https://www.python.org/downloads/), and have a text editor to edit Python files in. Any text editor will do. I use Sublime (https://www.sublimetext.com/3).
  • Some sections of this book use GitHub, and a GitHub account is recommended (https://github.com/join). Understanding how to use Git is not necessary for this book but is always useful. If you want to get started, this link has a useful tutorial: https://guides.github.com/activities/hello-world/.
  • A basic understanding of Python is also very useful for this book. If you are not there yet, feel free to spend some time getting to know Python better using this tutorial (https://docs.python.org/3/tutorial/) or any other of the freely and readily available tutorials out there, and come back here when you are ready. We also need to have the Streamlit library installed, which we will do and test in a later section called Installing Streamlit.

Why Streamlit?

Data scientists have become an increasingly valuable resource for companies and nonprofits over the course of the past decade. They help make data-driven decisions, make processes more efficient, and implement machine learning models to improve these decisions at a repeatable scale. One pain point for data scientists is in the process just after they have found a new insight or made a new model. What is the best way to show a dynamic result, a new model, or a complicated piece of analytics to a data scientist's colleagues? They can send a static visualization, which works in some cases but fails for complicated analyses that build on each other or on anything that requires user input. They can create a Word document (or export their Jupyter notebook as a document) that combines text and visualizations, which also doesn't work for user input and is harder to reproduce. Another option is to build out an entire web application from scratch using a framework such as Flask or Django, and then figure out how to deploy the entire app in AWS or another cloud provider. None of these options really work that well. Many are slow, don't take user input, or are suboptimal for informing the decision-making process so fundamental to data science.
Enter Streamlit. Streamlit is all about speed and interaction. It is a web application framework that helps you build and develop Python web applications. It has built-in and convenient methods for taking in user input, graphing using the most popular and powerful Python graphing libraries, and quickly deploying graphs to a web application.
I have spent the past year building Streamlit apps of all different flavors, from data projects for my personal portfolio to building quick applications for data science take-home problems, to even building mini-apps for repeatable analysis at work. I truly believe that Streamlit could be as valuable to you and your work as it has been to mine and wrote this to bring you quickly up to speed so you can accelerate your learning curve and get to building web applications in minutes and hours instead of days. If this is for you, read on! We will work in three sections, starting with an introduction to Streamlit, and ramp you up to building your own basic Streamlit applications. In part two, we'll extend this knowledge to more advanced topics such as production deployment methods and using components created by the Streamlit community for increasingly beautiful and usable Streamlit apps. And in the last part, we'll focus heavily on i...

Table of contents