Username Remember Me?
Password   forgot password?
   
   
Bayes2 Normal classifier error. 
Posted: 10 May 2009 02:45 PM   [ Ignore ]  
Newbie
Rank
Total Posts:  25
Joined  2009-04-17

I read the dataset from Excel file. It works. But when i tried to train it using Bayes 2Normal classifier, it shows error like this.The dataset created is 5 % matrix where the last column tells the class name (0 or 1).

a=xlsread(’Book1.xlsx’)

a =

1 2 3 4 4 1
2 4 4 4 4 1
3 4 4 4 4 0
3 4 1 3 4 0
2 4 4 6 6 1

>> w1=ldc(a)
??? Undefined function or method ‘islabtype’ for input arguments of type ‘double’.

Error in ==> ldc at 95
islabtype(a,’crisp’,’soft’);

Profile
 
 
Posted: 11 May 2009 11:58 AM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  236
Joined  2008-04-26

Dear Park,

to use PRTools classifeirs such as ldc, you need to create a dataset object from your data matrix and specify the sample labels.

The following code creates a dataset labeled with the content of the last column:

>> data=[1 2 3 4 4 1 2 4 4 4 4 1 3 4 4 4 4 0 3 4 1 3 4 0 2 4 4 6 6 1]

data 
=

     
1     2     3     4     4     1
     2     4     4     4     4     1
     3     4     4     4     4     0
     3     4     1     3     4     0
     2     4     4     6     6     1

>> a=dataset(data(:,1:end-1),data(:,end))
5 by 5 dataset with 2 classes[2  3]

>> w=ldc(a)
PR_WarninggetpriorldcNo priors found in dataset, class frequencies are used instead
Bayes
-Normal-15 to 2 trained  mapping   --> normal_map

Hope it helps,

Pavel

Profile
 
 
Posted: 11 May 2009 02:09 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  25
Joined  2009-04-17

Thanks Pavel.
It works.

Profile