Heading image


  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


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

Predicting Victorian State Elections: STRONG Transition Model

Hurricane Henri: A Data Story

Top 4 Data Science Podcasts You Should Follow

Let’s Draw 5 Flags in NumPy


Sapiens Cowork: A Refreshing View from Punta Cana

Random Forest In R With Examples

Time-Series Forecasting: Predicting Stock Prices Using An LSTM Model

GDP vs Infant Mortality Rate

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

Don’t Buy Alexa Create Your Own Using Python -less than 50 Lines of Code

Alexa from Amazon

How to build a Custom Bingo Board with Python

How to Prevent Error in Python

A Multi-layer Perceptron Classifier in Python; Predict Digits from Gray-Scale Images of Hand-Drawn…