Code covered by the BSD License  

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Statistical Learning Toolbox

4.8 | 34 ratings Rate this file 72 Downloads (last 30 days) File Size: 4.94 MB File ID: #12333 Version: 1.0

Statistical Learning Toolbox


Dahua Lin (view profile)


20 Sep 2006 (Updated )

Functions for statistical learning, pattern recognition and computer vision, covering many topics.

| Watch this File

File Information

Introduction to sltoolbox

sltoolbox (Statistical Learning Toolbox) organizes a comprehensive set of matlab codes in statistical learning, pattern recognition and computer vision. It includes 256 m-files in 24 categories, which are from low-level computational routines to high-level frameworks and algorithms. The toolbox have following main features:

(1) it covers many active research topics in learning and vision, including classification, regression, statistical modeling, finite mixture model, graph theory-based learning, subspace learning, kernel learning, manifold learning, tensor algebra, vector quantization and vocabulary learning.

(2) it offers many useful utilities to facilitate your experiments in matlab, including a set of kits to manipulate data, text and files. In addition, it offers a matlab-based script system called experiment description language with an xml-based experiment control system to help you run a large batch of experiments with ease.

(3) it is highly optimized. Much efforts have been devoted to improve the run-time efficiency of the codes. It is achieved with three ways: deducing equivalent mathematical forms for fast computation, grouping the operations into matrix-based computations to maximum degree, and writing the codes in cpp-mex for those cannot be organized into matrix computation.

(4) it is flexible and extensible. For most of the functions, you can control a lot of properties to adapt its behaviour to your need. For many algorithms, the implementations support weighted samples so that you can easily incorporate the algorithm into the environment using weights. In addition, in some of the algorithms, you can change the functions' behaviour by supplying your own call-back function. For example, in K-means, you can specify your special function to measure distances or compute means; in spectral learning, you can specify your function to caculate the graph edge weights in your own manner.

(5) it is well organized. The whole toolbox is organized according to the rules in software engineering. They are not a simple collection of many algorithms, but a carefully designed system, so that the codes can be maximally reused and cooperate well.

(6) it is easy to use. Detailed help information is given for each m-file. I have tried to design friendly interfaces to user. For most of the functions, you can use a small number of arguments to invoke them in default settings, when you would like to gain more control on their behaviour, you can tell them your specification by setting properties, such as
       f(x1, x2, 'propertyname1', propertyvalue1, 'propertyname2', propertyvalue2, ...)

(7) it is robust. Attention has been paid to the numerical stability of the computations and some steps have been taken to enhance the stability. In addition, a lot of error-checking statements are used to check the consistency of the input arguments. I have tried to lie a good balance between robustness and effiency, and increase the robustness without notably compromising the run-time speed.

The following is a brief list of the functions offered in sltoolbox.

It contains the following categories:

core: The core computational routines. The efficient implementation of a set of common computation routines.
smallmat: Fast functions to compute on a set of small matrices
utils: A set of useful toolkits to manipulate data.
utils_ex: Other useful kits
fileio: Facilities to manage files
text: Kits to parse and manipulate strings and texts.
perfeval: classification performance evaluation
imgproc: Functions for image-based learning and batch image processing
visualize: Visualization of data and models
xmlkits: small kits to extract information from XML elements

ann: Approximate nearest neighbors by KD-tree
cluster: Data clustering
discrete: Vector quantization, vocabulary building and histogram-based computation
graph: Graph (the graph in graph theory) contruction
interp: Interpolation kernels
kernel: Kernel learning and kernelization
learn: Some basic learning architectures
regression: Linear and Logistic regression
stat: Statistical modeling and Finite mixture model (such as GMM)
subspace: Representative subspace learning algorithms
subspace_ex: Subspace learning algortihms for very high-dimension data
manifold: Manifold embedding learning
tensor: Tensor algebra
expdl: Experiment description language

Required Products Optimization Toolbox
MATLAB release MATLAB 7.2 (R2006a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (45)
05 May 2015 fan feng  
26 Mar 2015 Pete sherer

Good tool

05 Jul 2013 An Tran Lam

very nice work, I also start to learn about statistical learning

Comment only
27 Feb 2013 Ibraheem Al-Dhamari

Hi Dahua,
I am trying to use the 2D PCA but I don't get what are the parameters. e.g. Left Projection matrix? It would be better if you make the user input only the images and the function computes the other parameters.

Comment only
22 Feb 2012 Natasha

How can I mex the ann wrapper (I have obtained the source code). Can you provide the exact form of the mex command you have used? For instance, I am having trouble linking the input/output streams, and I'd like to know what library you linked in to resolve that.

Comment only
28 Dec 2011 Chris

Chris (view profile)

Big fan

Comment only
05 Dec 2011 Yung

Yung (view profile)

thanks for sharing.

Comment only
21 Nov 2009 Raymond Cheng

Thanks for your sharing, nice tutorial.

25 May 2009 Patricia

Hi. I can't make it compile, could someone please send me the mex compiled file?

Comment only
05 Jan 2009 Anton

Anton (view profile)

This submission definitely stands out. A great and versatile package. For those interested in classification I invite you to visit

02 Oct 2008 Ashwin Sundar

what ever code i need is present here, thank you for such hefty work.......

21 Sep 2008 Henry Cong  
04 Sep 2008 Santanu Ghorai

Hudge relief from writing codes and save lots of time. Many many thanks!

Comment only
27 Aug 2008 Richard Ang

your fans!

07 Aug 2008 jack moog

I cant make it to compile in matlab 2008a. Can anybody upload the mex compiled file (or just the whole package where it has already been compiled ) to me ?

Comment only
01 Aug 2008 Siqing Wu

Awesome, thanks a lot~

20 Apr 2008 zedairia imad

je veux le programme de classification des images parGMM

Comment only
03 Apr 2008 Ben Kang  
17 Mar 2008 saad mehmood  
25 Oct 2007 George Hook


02 Jul 2007 Dahua Lin

In am now working in the version 2 of the toolbox based on the new version R2007a.
There is an important new function bsxfun, which effectively covers the functionality offered by the m-files in the core directory.
In addition, I have test its performance. It is surprising that bsxfun works in a comparable or even faster speed than C-coded mex functions.
Therefore, in the next version, the core computation will be based on that function instead of hand-coded C-mex.

Comment only
29 Jun 2007 Chen Hailin  
27 May 2007 kiang gao  
18 May 2007 ali noori


25 Apr 2007 hakan ertem  
03 Apr 2007 Bobby Bob

Kick butt!

08 Mar 2007 Wang Lei

very nice,but i see error when try slfld(X,nums,'prepca',true);in line 170, T1 should be replaced by TW

01 Mar 2007 Ao Li


01 Mar 2007 satheesh kumar r  
23 Feb 2007 hjksd sjdsjs

great work indeed; but i wonder why "sllda" method cant take precomputed Sw and Sb parameters together with 'regdual'

29 Jan 2007 Abudula Muhamode

no demo code, really like a garbage collection

26 Jan 2007 ya to

may like sl garbage collection

Comment only
23 Jan 2007 xiaoming liu


14 Jan 2007 Victor Fang

It's amazing work!

24 Nov 2006 cc cc


21 Nov 2006 BASSAm ALQADI

Thanks alot

03 Nov 2006 zhaofeng he

Thanks Dahua, it is excellent.

30 Oct 2006 sixing zhu

the toolbox is very good

06 Oct 2006 Olufemi Omitaomu

I would have love to see a content file for each folder. Thanks anyway.

01 Oct 2006 Jianhua Zhao

Very good!

24 Sep 2006 Dahua Lin

A new version of package (v1.01) with manual and tutorial has been uploaded, and they are expected to be available in one to two days.

22 Sep 2006 Siyi Deng

This toolbox is quite helpful. The code quality is generally high and could serve as good examples.

21 Sep 2006 Jessie Dai

nice work:)

21 Sep 2006 Laurel Xiao

It has a good kmeans, good slmetric_pw and good sldistmean, and very powerful to calculate distances.

21 Sep 2006 nina luan  

Contact us