Code covered by the BSD License  

Highlights from
Machine Learning with MATLAB

4.1 | 10 ratings Rate this file 204 Downloads (last 30 days) File Size: 882 KB File ID: #42744 Version: 1.3
image thumbnail

Machine Learning with MATLAB


Abhishek Gupta (view profile)


05 Aug 2013 (Updated )

These are the supporting MATLAB files for the MathWorks webinar of the same name.

| Watch this File

File Information

** Update: The webinar recording is available at:

In this webinar you will learn how to get started using machine learning tools to detect patterns and build predictive models from your datasets. In this session, you will learn about several machine learning techniques available in MATLAB and how to quickly explore your data, evaluate machine learning algorithms, compare the results, and apply the best machine learning for your problem.

Highlights include unsupervised and supervised machine learning techniques including:
• K-means and other clustering tools
• Neural Networks
• Decision trees and ensemble learning
• Naïve Bayes Classification
• Linear, logistic and nonlinear regression


Rotate X Labels( Ax, Angle, Varargin ) and Plot Groups Of Stacked Bars inspired this file.

Required Products Fuzzy Logic Toolbox
Neural Network Toolbox
Parallel Computing Toolbox
Statistics and Machine Learning Toolbox
MATLAB release MATLAB 8.1 (R2013a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (17)
25 May 2015 Mark Knecht

Sadly, another case of creeping package usage in MatLab. Great for people who have access to everything MatLab offers. Not so good for the rest of us.

05 Mar 2015 Birsen

Birsen (view profile)

The presentation.m is not in the download folders as in the webinar.
The webinar is not for someone is new in that subject, the explanations are for the ones who already knows machine learning

10 Feb 2015 Alecesa

Hi Gupta,

I am new to Matlab but in trying to replicate the code script provided, I had the same error as reported by Saida. tried the Bank.csv and Bank-full.csv and the problem repeats as follows:

Trial>> bank = ImportBankData('bank-full.csv');
names = bank.Properties.VarNames;
Undefined function 'ImportBankData' for input arguments of type 'char'.

Any support/suggestion would be appreciated.


Comment only
09 Feb 2015 Abhishek Gupta

Abhishek Gupta (view profile)

Hi Benjamin,

Excellent question. Currently, there is no way to inform SEQUENTIALFS about the categorical predictors. Thus, it treats all predictors as numeric. The development team is aware and they plan to add this capability in a future release of our tools.

Hi Himakshi,

It is hard for me to predict (no pun intended) the cause of the error at your end. Please feel free to reach out to our technical support team:

Comment only
05 Feb 2015 Benjamin

How are the categorical predictors handled in the sequentialfs step in MachineLearning.m line 430 if the logical matrix catPred isn't used in the critfun or in sequentialfs? Thanks for the clarification.

05 Feb 2015 Benjamin  
27 Jan 2015 Gareth Thomas  
19 Jan 2015 himakshi Shekhawat

hi, I have run your code as i have to do similar work but your code is not reading data from the file bank-full.csv and is returning 0 rows. As the error is
??? Error using ==> cvpartition>cvpartition.cvpartition at 137
The number of observations must be a positive integer greater than one.
I am not able to understand why it is not reading data from rows of csv file

Comment only
10 Dec 2014 Abhishek Gupta

Abhishek Gupta (view profile)

Hi Azadeh and Saida,

I tried executing all the code in the recent releases of MATLAB and am unable to reproduce the errors. This maybe something specific to your setup. Please contact technical support for further help:

Comment only
08 Dec 2014 Saida

Saida (view profile)

I keep trying to follow your code but the very first line gives me an error.

>> bank=ImportBankData('bank-full.csv');
Undefined function 'ImportBankData' for input arguments of type 'char'.

Comment only
25 Nov 2014 Azadeh

Azadeh (view profile)

I run MachineLearning.m on sample dataset bank-full.csv and got this error:

Default value is not a member of type "nntype.performance_fcn".
Error using nnetParamInfo (line 28)
Too many input arguments.

Error in patternnet>get_info (line 85)
info = nnfcnNetwork(mfilename,'Pattern Recognition Neural Network',fcnversion, ...

Error in patternnet (line 41)
if isempty(INFO), INFO = get_info; end

Error in NNfun (line 18)
net = patternnet(hiddenLayerSize);

Error in MachineLearning (line 191)
[~, net] = NNfun(XtrainNN,YtrainNN);

Comment only
14 Aug 2014 Mehmet

Mehmet (view profile)

24 Apr 2014 Abhishek Gupta

Abhishek Gupta (view profile)

Hi Remi,

The data for the classification example is available here:

I believe that I have mentioned this in the readme.

Comment only
21 Apr 2014 Rémi Larouche

The CSV file is missing ('bank-full.csv').

28 Dec 2013 Wenwu

Wenwu (view profile)

Thanks, nice webinar and supplementary files.

16 Dec 2013 PRIYA

PRIYA (view profile)

08 Dec 2013 Sergey

Sergey (view profile)

05 Aug 2013 1.2

Added webinar link

30 Jul 2014 1.3

Updated webinar link

Contact us