As we use data from multiple sources, we will find them stored in many formats. One of the most common ways of storing data is in a database. In this chapter, we will use SQLlite to send queries to different databases, and import data from those databases into a pandas DataFrame. Then we will use the data to model different situations and predict outcomes.
9.1.1. Learning Goals¶
Manipulate data from a database using Structured Query Language.
Use linear regression to model the relationship between predicted data and actual data.
Create models that we can use to predict outcomes.
9.1.2. Learning Objectives¶
Import a SQL database into a Pandas DataFrame.
Retrieve, sort, and aggregate data from a database.
Join and extract data from multiple databases.
Visualize data over a time series.
Use a Linear Regression model to identify Mean Squared Error and Mean Absolute Error.
Use the train-test split method to create and test models.
Add features and use machine learning libraries to refine models and predictions.