This page contains a selection of miscellaneous MATLAB tools, tircks and demos that I have written and am making available free for non-commercial use under the terms of the GNU General Public License (license.txt). I would be grateful if you would email me to let me know about any bugs you find or to give suggestions for improvements. If you find this software useful, please add a footnote in any resulting publication giving the URL of this page and let me know about it - the more times a peice of software is used successfully, the more reassured we can be that it is correct!
You may also be interested in my MATLAB Support Vector Machine (SVM) toolbox.
Sammon's nonlinear mapping algorithm [1] attempts to find a low-dimensional (normally 2- or 3-d) representation of a set of points distributed in a high dimensional pattern space, such that the Euclidean distance between points in the map are as similar as possible to the Euclidean distance between the corresponding points in the high-dimensional pattern space. For example, the image to the right shows a Sammon map of Fisher's famous Iris dataset [2], which records the widths and lengths of the petals and sepals of three varieties of Iris flowers (Setosa, Virginica and Versicolour). In this case the Sammon mapping produces a two-dimensional visualisation of the structure of a four-dimensional dataset. The value of the stress of the mapping in this case is very low (stress << 0.1), which indicates that the mapping gives a good idea of the underlying structure of the data.
The algorithm is implemented essentially as described in [1], except for the following:
[1] | Sammon, John W. Jr., "A Nonlinear Mapping for Data Structure Analysis", IEEE Transactions on Computers, vol. C-18, no. 5, pp 401-409, May 1969. |
[2] | Fisher, R. A. "The use of multiple measurements in taxonomic problems", Annual Eugenics, vol. 7, Part II, pp 179-188, 1936. |
Back to the top
[R, p] = CHOLINCSP(X) finds a lower triangular Cholesky factor, R, of a symmetric positive semi-definite matrix, X, using the incomplete Cholesky factorisation with symmetric pivoting due to Fine and Scheinberg [1]. The second output argument, p, specifies a permutation of X, such that R*R' = X(p,p). If R has n columns, then the first n elements of p specify a set of linearly independent columns of X that provide a basis for the remaining columns of X (or at least a very close approximation). CHOLINCSP is useful to anyone interested in kernel learning methods, as it can be used to find a set of representers for constructing sparse kernel machines (i.e. the kernel expansion only includes terms corresponding to the training patterns represented by the columns of the Gram or kernel matrix used to form the Cholesky factor R, i.e. p(1:n)).
[1] | Fine, S. and Scheinberg, K., "Efficient SVM training using low-rank kernel representations", Journal of Machine Learning Research, vol. 2, pp 243-264, December 2001. |
Back to the top
hidemexfun.m provides a template for a simple trick allowing the use of MEX files to be hidden from the user, essentially by transparently compiling the MEX file the first time it is required. This is useful for distributing MATLAB packages containing MEX files in a reasonably platform independent manner. Basically, the first time the function is invoked, the MEX file will not have been compiled yet, so it will be m-file that is executed. The m-file then attempts to compile the MEX implementation and if sucessfull it recursively invokes itself. This time, the MEX file has been recompiled, so the compiled MEX function for that platform will now be present and MATLAB will invoke that version instead. The varargs mechanism is used to pass on all input and output arguments to the compiled MEX function. The rehash command is used to make sure that MATLAB notices that a compiled MEX version has appeared.
Back to the top
An ROC (Receiver Operating Characteristic) curve is a plot of the true positive rate as a function of the false positive rate of a classifier system as the score defining the decision threshold is varied. This toolkit implements some of the basic methods for constructing and processing ROC curves discussed by Fawcett [1] and Provost and Fawcett [2]. The area under the ROC curve is a reasonable performance statistic for classifier systems assuming no knowledge of the true ratio of misclassification costs.
[1] | Fawcett, T., "ROC graphs : Notes and practical considerations for researchers", Technical report, HP Laboratories, MS 1143, 1501 Page Mill Road, Palo Alto CA 94304, USA, April 2004 (pdf). |
[2] | Provost, F. and Fawcett, T., "Robust classification for imprecise environments", Machine Learning, vol. 42, no. 3, pp. 203-231, 2001. |
Back to the top
This is a re-packaging of the thirteen benchark datasets from Gunnar Raetsch's web-site in order to conserve disk-space. These benchmark datasets have been widely used in model selection studies in kernel learning methods (e.g. [1-3]). Each benchmark is stored in a structure containing the unique input and target patterns, and a set of indices giving the 100 training and test splits (20 in the case of the image and splice datasets). For example, to reconstitute the forty-second realisation of the banana benchmark,
>> load bencharks.mat banana >> x_train = banana.x(banana.train(42,:),:); >> t_train = banana.t(banana.train(42,:)); >> x_test = banana.x(banana.test(42,:),:); >> t_test = banana.t(banana.test(42,:));
[1] | G. Raetsch, T. Onoda and K.-R. Muller, "Soft margins for AdaBoost", Machine Learning, vol. 43, no. 3, pp 287-320, March 2001. | [2] | S. Mika, G. Raetsch, J. Weston, B. Scholkopf and K.-R. Muller, "Fisher discriminant analysis with kernels", in Neural Networks for Signal Processing IX, pp 41-48, 1999. | [3] | Cawley, G. C. and Talbot, N. L. C., "Efficient leave-one-out cross-validation of kernel Fisher discriminant classifiers", Pattern Recognition, vol. 36, pp 2585-2592, 2003. |
Back to the top
Heteroscedastic Kernel Ridge Regression (HKRR) is a non-linear regression method for data exhibiting a heteroscedastic (input dependent) Gaussian noise process. The HKRR provides a model of both the conditional mean and the conditional variance of the target distribution. A more realistic estimate of conditional variance can be obtained using the leave-one-out cross-validation estimate of the conditional mean, giving the Leave-One-Out Heteroscedastic Kernel Ridge Regression (LOOHKRR) model (generally gives broader error bars). These methods are described in [1]. The demo given below applied conventional kernel ridge regression, HKRR and LOOHKRR methods to Silverman's motorcycle benchmark dataset.
[1] | G. C. Cawley, N. L. C. Talbot, R. J. Foxall, S. R. Dorling and D. P. Mandic, "Heteroscedastic Kernel Ridge Regression", Neurocomputing, vol. 57, pp 105-124, March 2004. (pdf, doi) |
Back to the top
Will appear here shortly...
[1] | G. C. Cawley, "Leave-one-out cross-validation based model selection criteria for weighted LS-SVMs", Proceedings of the International Joint Conference on Neural Networks (IJCNN-2006), pages 1661-1668, Vancouver, BC, Canada, July 16-21 2006. (pdf) |
Back to the top
This section will eventually contain a set of simple routines for non-linear optimisation problems. The first routine implements the Nelder-Mead simplex algorithm [1] for minimisation without the need for computing gradient information, providingmore or less the same functionality as the fminsearch routine from the MATLAB Optimisation Toolbox.
[1] | J. A. Nelder and R. Mead, "A simplex method for function minimization", Computer Journal, vol. 7, pages 308-313, 1965. |
Back to the top
Research Team: Gavin Cawley, Nicola Talbot.