Subscribe to DSC Newsletter

Can we use deliberate practise for learning to code #AI and #machinelearning

In this post, I explore if ideas of deliberate practise can be applied to teaching coding for Artificial Intelligence / Machine Learning

I am exploring these ideas in a free coding workshop/ meetups in London.

There is already a waiting list.

We may hold more workshops next year depending on how these go.

But in this post, I outline the rationale of the learning strategy used

I have been involved in teaching Data Science for a few years now (Oxford University - Data Science for Internet of Things and also online). Over the years, I have tried to improve my teaching .. and adopt ideas from other domains into my teaching

One such technique is Deliberate practice a technique which probably originated in the former Soviet Union to train world class athletes. Deliberate practise is also used in learning complex skills like playing the violin – which require mastering many small steps and then putting the steps together in a complex whole (like a violin concert)

James Clear (whose writings I recommend) says of Deliberate practice

Deliberate practice always follows the same pattern: break the overall process down into parts, identify your weaknesses, test new strategies for each section, and then integrate your learning into the overall process.

And provides examples like

Cooking: Jiro Ono, the subject of the documentary Jiro Dreams of Sushi, is a chef and owner of an award-winning sushi restaurant in Tokyo. Jiro has dedicated his life to perfecting the art of making sushi and he expects the same of his apprentices. Each apprentice must master one tiny part of the sushi-making process at a time—how to wring a towel, how to use a knife, how to cut the fish, and so on. One apprentice trained under Jiro for ten years before being allowed to cook the eggs. Each step of the process is taught with the utmost care.

There are essentially six steps to Deliberate practise 

1. Get motivated
2. Set specific, realistic goals
3. Break out of your comfort zone
4. Be consistent and persistent
5. Seek feedback
6. Take time to recover

So, the question is: Can we apply deliberate practise to learning coding for AI?

To try this, we work in small sections of code which you should master bit by bit

We divide the code into four sections

1) Pandas, NumPy and MathPlotLib

2) Data manipulation and feature engineering

3) Machine Learning models and validation·

4) Deep learning

Each of these topics is divided into detail (subtopics) as below

(note the code itself is taken from the public domain and from existing books under Apache v2 license)

Pandas, NumPy and MathPlotLib 
· initializing NumPy array
· Creating NumPy array
· NumPy datatypes
· Field access
· Basic slicing
· Advanced indexing
· Array math: Sum function, Transpose function
· Broadcasting
· Creating a pandas series
· Creating a pandas dataframe
· Reading / writing data from csv, text, Excel
· Basic statistics on dataframe
· Creating covariance on dataframe
· Creating correlation matrix on dataframe
· Concat or append operation, Merge, join dataframes
· Grouping operation, Pivot tables on Dataframe
· Plots, Bar charts, Pie charts etc for DataFrames

Data manipulation and feature engineering
· Converting categorical variable to numerical
· Normalization and scaling
· Univariate analysis
· Pandas dataframe visualization
· Multivariate analysis
· Correlation matrix
· Pair plot
· Scatter plots
· Find outliers
· Load data
· Normalize data
· Split data into train and test

Machine Learning models and validation·
Linear regression
· Linear regression model accuracy matrices
· Polynomial regression
· Regularization
· Nonlinear regression
· Logistic regression
· Confusion matrix
· Area Under the Curve
· Under-fitting, right-fitting, and over-fitting
· Logistic regression model training and evaluation
· Generalized Linear Model
· Decision tree model
· Support vector machine (SVM) model
· Plotting SVM decision boundaries
· k Nearest Neighbors model
· k-means clustering

Deep Learning·
sklearn perceptron code
· loading MNIST data for training MLP classifier
· sklearn MLP classifier
· Bernoulli RBM with classifier
· grid search with RBM + logistic regression
· Keras MLP
· Compile model
· Train model and evaluate
· dimension reduction using autoencoder
· de-noising using autoencoder
· Keras LSTM

Comments welcome

Does this approach make sense? i.e. would we be able to use the ideas of Deliberate practise in learning coding for AI and Machine Learning

many thanks for the great responses to this post
I have also had feedback from educators 
Here are three additional comments to add
a)  Paired programming - Paired programming has its pros and cons but it a structured learning environment, could help learners who are very new to coding
b)  Understanding the big picture - first explaining some worked examples and then going through the steps of practising in very small segments but relating back to the big picture
c)  learning from teachers in a classroom - not all ideas here apply but many that can be used
we have now launched this program online at a discounted rate
Please contact [email protected] if you are interested

Image source: Vanessa Mae – Violin prodigy/ player 


Views: 2322


You need to be a member of Data Science Central to add comments!

Join Data Science Central

Comment by Lance Norskog on August 23, 2018 at 5:35pm

I started DL not with TF/Keras/Pytorch but by directly coding all the arithmetic in Python, starting with this book:

It really helped me understand the basics. I took his code, did some variations like an autoencoder, and had a lot of fun learning how all the gears mesh when I turn the crank on an MLP.

Doing TF/Keras/Pytorch is fine when you already have a grasp on what it has to do to follow your high-level instructions. I started programming in machine language, then assembly, then C, sooooo... I prefer a bottom-up approach.

Comment by ajit jaokar on August 22, 2018 at 9:29pm

@chris - maths .. not really. its fine to start with coding. if you connect with me on linkedin etc .. shall share as we develop. thanks for your comment

Comment by ajit jaokar on August 22, 2018 at 9:27pm

@milton - I shall keep you posted. I am working on it in a group (in London) and then we see how it goes. thanks for your comment

Comment by ajit jaokar on August 22, 2018 at 9:26pm

@salil - many thanks

Comment by Salil Athalye on August 22, 2018 at 5:25pm

Ajit - your article inspired me to create a GitHub repo where I'll endeavor to research each topic area and develop the code in both R/tidyverse and Python/Pandas.

Comment by Milton Labanda on August 22, 2018 at 12:07pm

very interesting, I have many experiences of having died in the attempt, because of lack of time to practice or because I reach a level that I feel is complex. Sometimes I think that applying for a PhD related to Data Science would help me to demand to complete the learning finally, but at the same time I think it is a higher risk of failure. I'm going to apply this method to see how it works.

Comment by Chris Romano on August 22, 2018 at 9:38am

Very nice article and I have applied the same approach with teaching/tutoring mathematics and other topics and it has always worked extremely well.  I am currently new to the field and disciplines within AI and apply this exact approach and so far, I have been learning very quickly and more importantly, developing an understanding. 

The positive is the material learning and recall however, it is time consuming however, focusing on areas that are unfamiliar help focus the topics instead of spending time on topics I am familiar with therefore improving time efficiency.

I do have one question for all the "experts" how do you track all of the different algorithms and syntax while working on projects?  My question is, will all of the code, syntax, steps, and different libraries become embedded in memory (my memory) or do you keep the common information referenced via a document/notebook/etc?

All that said, I believe being proficient in the fundamentals (including the mathematics) is essential to building upon the knowledge within the field of AI.  In other words, as someone new to AI, my advice to others I have spoken with is to learn the math and understand it and also insure that the fundamentals are well understood as they work through data science, machine learning, and into the more advanced topics.

Lastly, actually coding and practicing is paramount, simply reading or following examples is not going to aid in actually learning and applying so, directly related to this article, I tend to target data sets and work through the modeling to achieve the result so that I can prove the modeling is accurate and then work on improving it.

(perspectives from someone entering the field yet, I have extensive experience in other fields which have helped).

Thank you for the article and I look forward to replies on how everyone retains all of the details.

Follow Us


© 2018   Data Science Central ®   Powered by

Badges  |  Report an Issue  |  Privacy Policy  |  Terms of Service