Heading image

Prerequisites

  1. Familiarity Conda package, dependency and virtual environment manager. A handy additional reference for Conda is the blog post “The Definitive Guide to Conda Environments” on “Towards Data Science”.
  2. Familiarity with JupyterLab. See here for my post on JupyterLab.
  3. These projects will also run Python notebooks on VSCode with the Jupyter Notebooks extension. If you do not use VSCode, it is expected that you know how to run notebooks (or alter the method for what works best for you).

Getting started

Let’s create the regression-with-scikit-learn directory and install the required packages.

Exploring the Boston dataset

In this example, we will use the Boston housing dataset to predict the price of a house.

Visualizing the data

We can take the variables we have assign X_rooms and y to visualize the data.

Value of house /1000 ($) vs Number of rooms

Creating a regressor to predict a continuous target variable

Finally, we can build a linear regressor to predict the MEDV variable.

Adding the line to the data

Summary

Today’s post was an introduction to regression with Scikit Learn. We used the Boston dataset to predict the MEDV variable.

Resources and further reading

  1. Conda
  2. JupyterLab
  3. Jupyter Notebooks
  4. “The Definitive Guide to Conda Environments”
  5. okeeffed/regression-with-scikit-learn

--

--

--

Senior Engineer @ UsabilityHub. Formerly Culture Amp.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Mixed Models of chick’s weight

8 Reasons to Start Using Pydantic to Improve Data Parsing and Validation

Python — Extract Day Level Weather Data

Top 4 Free Books for Machine Learning and Deep Learning

What is a Data Puddle?

Deep Diving Into SMOTE

Visualizing Black-Scholes Option Pricing

Classification Metrics for Beginners

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dennis O'Keeffe

Dennis O'Keeffe

Senior Engineer @ UsabilityHub. Formerly Culture Amp.

More from Medium

Creating a Swiss-style Tournament Manager — Part 1: Match Making

The easiest way to parallelize pandase

Here’s a quick way to solve a business problem with python