King's College London

Research portal

A step-by-step tutorial on how to build a machine learning model

Research output: Chapter in Book/Report/Conference proceedingChapter

Original languageEnglish
Title of host publicationMachine Learning
Subtitle of host publicationMethods and Applications to Brain Disorders
Number of pages28
ISBN (Electronic)9780128157398
ISBN (Print)9780128157398

King's Authors


In this chapter, we provide a step-by-step tutorial on the implementation of a standard supervised machine learning pipeline using Python programming language. We use a toy dataset with neuroimaging-based data (i.e., gray matter volume and thickness from different brain regions extracted with FreeSurfer) to classify patients with schizophrenia and healthy controls using a Support Vector Machine. Both the toy dataset and the source code are available to download. This tutorial is aimed at the machine learning novice and assumes minimal programming experience. Instructions on how to install Python and the necessary libraries are provided. In the last section, we discuss how the analysis pipeline can be improved and how the sample code can be adapted to other neuroimaging-based data and other data modalities that are used in brain disorders research.

View graph of relations

© 2020 King's College London | Strand | London WC2R 2LS | England | United Kingdom | Tel +44 (0)20 7836 5454