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

Cross-validation

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.

Summary

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

How to select machine learning algorithm for your problem?

Mercari Price Suggestion Challenge : An end to end machine learning case study

Social_Distancing_Measurer.

Optimization Algorithms in Deep Learning

Week 5# Identification of Artists and Movements from Paintings with Machine Learning

Titanic: Machine Learning Disaster

Automatic Image Captioning : Building an image-caption generator from scratch !

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

Start to work quickly with GPUs in Python for Data Science projects.

Use Of Keywords And Identifiers

Benchmarking Pyomo

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