Username Remember Me?
Password   forgot password?
   
   
[ FIXED ]An error encountered during using Prtool and the relevant book
Posted: 18 December 2008 07:21 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  13
Joined  2008-11-28

Hi ,

I have purchased the book

‘Classification,Parameter Estimation and State Estimation--an engineering approach using MATLAB’

. And,I ran the demos of this book - list7.7 & list7.6. I got the listings and data from http://www.prtools.org/book.html . However, some erros were reported by Prtool(4.1). I do not know why.Could I get some help here? The errors and codes are listed here for convenience:

??? Error using ==> setlabtype at 44
Soft labeled datasets should contain at least one 
class

Error in ==> Listing77 at 2

List 7.6:

setlabtype(z,'soft');    % Set probabilistic labels

load nutsbolts_unlabeled
;    % Load the data set z
setlabtype(z,'soft');    % Set probabilistic labels
[lab
,w] emclust(z,qdc,4);  % Cluster using EM
figure
clfscatterd(z);
plotm(w,[],0.2:0.2:1);       % Plot results

List 7.7

load nutsbolts_unlabeled;    % Load the data set z
setlabtype(z,'soft');    % Set probabilistic labels
                             
Cluster 1D PCAs using EM
[lab
,w] emclust(z,qdc([],[],[],1),4);
figureclfscatterd(z);
plotm(w,[],0.2:0.2:1);       % Plot results

[ Edited: 19 December 2008 01:57 AM by Robotech]
Profile
 
 
Posted: 18 December 2008 10:51 PM   [ Ignore ]   [ # 1 ]  
Moderator
RankRankRankRank
Total Posts:  253
Joined  2008-11-08

The scripts in the book are checked with a previous version of PRTools, which can be obtained from the website. Newer versions of PRTools are sometimes not fully compatible. Here we have an example:

load nutsbolts_unlabeled; % Load the data set z
z

94 by 2 dataset with 0 classes: []

setlabtype(z,'soft'); % Set probabilistic labels

??? Error using ==> dataset.setlabtype
Soft labeled datasets should contain at least one class

The dataset z is unlabeled. In previous versions unlabeled objects were either
neglected, or, in case the total dataset was unlabeled, given the label ‘1’.
In the newer versions this was removed in order the give the user the responsibility
to handle unlabeled objects in his own way. As the dataset z has no labels, the label
type cannot be changed and an error is generated.

This can easily be fixed, in case you want to run the example with a newer version
of PRTools, by labeling the dataset:

load nutsbolts_unlabeled; % Load the data set z
setlabels(z,1);
setlabtype(z,'soft'); % Set probabilistic labels
[lab
,w] emclust(z,qdc,4); % Cluster using EM
figure
clfscatterd(z);
plotm(w,[],0.2:0.2:1); % Plot results

Bob Duin

Profile
 
 
Posted: 19 December 2008 01:46 AM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  13
Joined  2008-11-28

Hi, professor Duin!
Thank you very much for your detailed reply!

Profile
 
 
Posted: 19 December 2008 02:01 AM   [ Ignore ]   [ # 3 ]  
Newbie
Rank
Total Posts:  13
Joined  2008-11-28

After consindering your fixing method to this problem carefully, I got another fixing method in Prtool4.1.4 as follows. The codes of this method is just more compact.

z = setlabtype(z,’soft’); ——> z = setlabtype(z,’soft’,[]);

There is no difference in the result.

load nutsbolts_unlabeled;    % Load the data set z
setlabtype(z,'soft',[]);       % Set probabilistic labels
                                                
Cluster 1D PCAs using EM
[lab
,w] emclust(z,qdc([],[],[],1),4);
figureclfscatterd(z);
plotm(w,[],0.2:0.2:1);             % Plot results

Kun Feng

BobDuin - 18 December 2008 10:51 PM

The scripts in the book are checked with a previous version of PRTools, which can be obtained from the website. Newer versions of PRTools are sometimes not fully compatible. Here we have an example:

load nutsbolts_unlabeled; % Load the data set z
z

94 by 2 dataset with 0 classes: []

setlabtype(z,'soft'); % Set probabilistic labels

??? Error using ==> dataset.setlabtype
Soft labeled datasets should contain at least one class

The dataset z is unlabeled. In previous versions unlabeled objects were either
neglected, or, in case the total dataset was unlabeled, given the label ‘1’.
In the newer versions this was removed in order the give the user the responsibility
to handle unlabeled objects in his own way. As the dataset z has no labels, the label
type cannot be changed and an error is generated.

This can easily be fixed, in case you want to run the example with a newer version
of PRTools, by labeling the dataset:

load nutsbolts_unlabeled; % Load the data set z
setlabels(z,1);
setlabtype(z,'soft'); % Set probabilistic labels
[lab
,w] emclust(z,qdc,4); % Cluster using EM
figure
clfscatterd(z);
plotm(w,[],0.2:0.2:1); % Plot results


Bob Duin

[ Edited: 19 December 2008 02:08 AM by Robotech]
Profile
 
 
Posted: 03 October 2009 08:25 AM   [ Ignore ]   [ # 4 ]  
Newbie
Rank
Total Posts:  27
Joined  2009-08-29
BobDuin - 18 December 2008 10:51 PM

The scripts in the book are checked with a previous version of PRTools, which can be obtained from the website. Newer versions of PRTools are sometimes not fully compatible. Here we have an example:

load nutsbolts_unlabeled; % Load the data set z
z

94 by 2 dataset with 0 classes: []

setlabtype(z,'soft'); % Set probabilistic labels

??? Error using ==> dataset.setlabtype
Soft labeled datasets should contain at least one class

The dataset z is unlabeled. In previous versions unlabeled objects were either
neglected, or, in case the total dataset was unlabeled, given the label ‘1’.
In the newer versions this was removed in order the give the user the responsibility
to handle unlabeled objects in his own way. As the dataset z has no labels, the label
type cannot be changed and an error is generated.

This can easily be fixed, in case you want to run the example with a newer version
of PRTools, by labeling the dataset:

load nutsbolts_unlabeled; % Load the data set z
setlabels(z,1);
setlabtype(z,'soft'); % Set probabilistic labels
[lab
,w] emclust(z,qdc,4); % Cluster using EM
figure
clfscatterd(z);
plotm(w,[],0.2:0.2:1); % Plot results


Bob Duin

hello dear
i have trainset.mat ( 1599x6 118346 dataset object),and fullim.mat( 16384x18 2359296 double array) iwant write code for classification image involve 5 class, when write this code:
load trainset;
z=dataset(trainset);
z=setlabtype(z,’soft’[.9 .9 .9 .9 .9 ];
w=qdc(z);
load fullim.mat
nrow=412;
ncol=412;
T=dataset(fullim);
x=T*w*classc %%ERROR
??? Error using ==> dataset.setfeatsize

The total feature size does not fit with the real number of features.
This might be caused when mappings are applied to datafiles with objects of different size.

what can i do?

Profile