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 first clone the code from part two into the regression-with-scikit-learn-part-three directory.


At this stage, the docs/linear_regression.ipynb notebook currently has cells up to the point where we have created a train/test split regressor and scored all of our test data.

5-Fold Cross Validation diagram

Applying cross-validation

In our file docs/regression-with-scikit-learn-part-three, we can add the following to a new cell.


Today’s post demonstrated how to perform a k-folds cross validation with linear regression (in particular the 5-folds cross validation on our set).

Resources and further reading

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




Senior Engineer @ UsabilityHub. Formerly Culture Amp.

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

Recommended from Medium

What is Supervised Learning and its different types?

Sentence Correction Using RNN

Predicting the Result of an NBA Shot: Machine Learning Analysis Project

How to Find Weaknesses in your Machine Learning Models

frea ai decision tree michael berk data slice black box model explainability transparency trust accuracy ibm freaAI

WGAN — How to use AI to paint like Monet

Grid of final images generated by WGAN, each of them a painting in the style of Monet.

Evolution Strategies can be used to create adversarial examples to fool image classifiers in a…

How to build an AI that learns to play Pong

Demystifying Machine Learning And How It Provides Real Value To Marketers

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

Anemia Prediction Using Machine Learning Techniques

Using the U.S. Census Bureau API with Python

Predicting Parkinsonian Symptom Severity from Voice Recordings

Implementing stochastic gradient descent (SGD) in python