Known bugs and problems in PRTools
- Dataset conflict with Stats toolbox (solved by PRTools5!)
- MSE clashes between DIP Image and Neural Nets (solved in PRTools 5.3)
- Sizes do not match
- Some classes have no test objects (solved in the PRTools classifiers in PRTools 5.3)
- Undesired results of Matlab’s importdata when PRTools is in the path
- Undefined function or method ‘fieldnames’ for input arguments of type ‘double’.
This problem is solved in PRTools5
dataset class conflicts with the
dataset class in the Matlab toolbox
stats. A typical error message is:
??? Error using ==> dataset.dataset>dataset.dataset at 238 The parameter name is unrecognized or not legal in this context.
This happens when a PRTools
dataset command is catched by the
stats toolbox. Possible solutions:
- Change the order of the search path (File ->Set Path …) such that PRTools is at the top. Save it and give
clear classesat the Matlab prompt.
- If this doesn’t help, change the path as in 1, quit Matlab and restart. Give a PRTools command as the first, e.g.
a = gendatb.
- If this is still not sufficient, remove the Matlab
statstoolbox from the path.
In PRTools5 this problem has been solved by renaming the PRTools classes.
This problem is solved in PRTools 5.3
The Matlab Neural Net toolbox
nnet as well as the DIP Image Matlab interface
diptools contain a routine
mse. Both packages may be called by PRTools. An error is generated when the wrong
mse routine is called. The corresponding package should be moved to the bottom of the search
path to solve the problem.
In many ways sizes of datasets and mappings may not match in some of the PRTools routines. Usually this is an error caused by the user, but sometimes difficult to find. Possible causes are:
- A dataset
Cis applied to a mapping that has been trained by another dataset
Bwith a different feature size. This may be caused by first mapping a training set
Ato a subspace
found by PCA and then classifying the dataset
Cwith the same dimensionality as
Aby a classifier
Win the subspace
V. Examples of a wrong and a correct construct:
V = pcam(A,0.9); B = A*V; W = fisherc(B); testc(C,W)
V = pcam(A,0.9); B = A*V; W = fisherc(B); testc(C*V,W)
The correct version may also be written as:
- In the conversion of a datafile to a dataset (which may be performed automatically by PRTools duringoperations on datafiles) it is needed that every object of a datafile is represented by the same features. Especially in case the objects in the datafile are images and a pixel representation is used, it may happen that images have different sizes. The user should take care that by commands like
im_resizeobjects of equal size are produced.
- In complicated datafiles for which some preprocessing has been defined (e.g. by
filtim) wrong feature sizes may be set. The commands
setfeatsizemay be helpful to create a workaround.
getfeatsizeis useful for retrieving a feature size that is appropriate for the first object. This may be set by
setfeatsize(A,0)may by used, which sets the feature size to 0. Size checking is now passed by. The result however may be that another, less understandable error is encountered. In setting feature sizes it should be realized that they also define the shape of images, e.g. [32 32] is really needed instead of 1024 if further image operations are defined.Please send a message with a simple, clear and runnable example if you have serious problems.
In performance estimation by
testc an error is generated in case the test set has for some classes no objects:
??? Error using ==> testc Some classes have no test objects
In PRTools 5.3 trained classifiers will have information about all classes mentioned in the training dataset, even if these classes have no training objects but are just mentioned in the label list and class priors. If the test set is generated from a similar dataset the above error will not occur anymore.
In case the Matlab routine
importdata (and possibly others) tries to read a a file with the .txt extension, e.g.
test.txt, it calls inadvertently the PRTools routine
txtread. This does not generate an error, but the result might not be what is expected.
The solution is to remover
txtread.m from PRTools. It is already out-of-use for some time and is removed from recent releases of PRTools.
This error pops up in some operations on an old PRTools dataset. At some moment the ident-field of dataset (now prdataset) was redefined. An automatic conversion was their for a long time. It appeared to be very time-consuming in some situations. After it has been removed the above error might be generated by getident for old datasets.
The solution is to do the conversion by hand:
a = setident(a), for datasets generating the problem.