You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by warren <wa...@gmail.com> on 2012/08/14 04:39:03 UTC

Wrong number of attributes in the string

Hi all ,I'm a beginner.

when I try to run example : Partial Implementation

I got a error as fellow,Is there anyone encountered the same problem?

[warren@myhost ~]$ /opt/hadoop-1.0.0/bin/hadoop jar 
$MAHOUT_HOME/core/target/mahout-core-0.8-SNAPSHOT-job.jar 
org.apache.mahout.classifier.df.tools.Describe -p 
testdata/KDDTrain+.arff -f testdata/KDDTrain+.info -d N 3 C 2 N C 4 N C 
8 N 2 C 19 N L
Warning: $HADOOP_HOME is deprecated.

12/08/14 10:23:34 INFO tools.Describe: Generating the descriptor...
12/08/14 10:23:35 INFO tools.Describe: generating the dataset...
Exception in thread "main" java.lang.IllegalArgumentException: Wrong 
number of attributes in the string
     at 
com.google.common.base.Preconditions.checkArgument(Preconditions.java:92)
     at 
org.apache.mahout.classifier.df.data.DataLoader.parseString(DataLoader.java:67)
     at 
org.apache.mahout.classifier.df.data.DataLoader.generateDataset(DataLoader.java:204)
     at 
org.apache.mahout.classifier.df.tools.Describe.generateDataset(Describe.java:127)
     at 
org.apache.mahout.classifier.df.tools.Describe.runTool(Describe.java:116)
     at 
org.apache.mahout.classifier.df.tools.Describe.main(Describe.java:101)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)



Re: Wrong number of attributes in the string

Posted by warren <wa...@gmail.com>.
I resolved, because of my carelessness, I did not follow the document to 
delete the line that begins with @

On 2012年08月14日 10:44, chyi-kwei yau wrote:
> Hi,
> I met this problem before.
> You need to check your input data format is the same as you describe in
> "-d N 3 C 2 N C 4 N C 8 N 2 C 19 N L"
>
> Best,
> Chyi-Kwei Yau
>
> On Mon, Aug 13, 2012 at 10:39 PM, warren <wa...@gmail.com> wrote:
>> Hi all ,I'm a beginner.
>>
>> when I try to run example : Partial Implementation
>>
>> I got a error as fellow,Is there anyone encountered the same problem?
>>
>> [warren@myhost ~]$ /opt/hadoop-1.0.0/bin/hadoop jar
>> $MAHOUT_HOME/core/target/mahout-core-0.8-SNAPSHOT-job.jar
>> org.apache.mahout.classifier.df.tools.Describe -p testdata/KDDTrain+.arff -f
>> testdata/KDDTrain+.info -d N 3 C 2 N C 4 N C 8 N 2 C 19 N L
>> Warning: $HADOOP_HOME is deprecated.
>>
>> 12/08/14 10:23:34 INFO tools.Describe: Generating the descriptor...
>> 12/08/14 10:23:35 INFO tools.Describe: generating the dataset...
>> Exception in thread "main" java.lang.IllegalArgumentException: Wrong number
>> of attributes in the string
>>      at
>> com.google.common.base.Preconditions.checkArgument(Preconditions.java:92)
>>      at
>> org.apache.mahout.classifier.df.data.DataLoader.parseString(DataLoader.java:67)
>>      at
>> org.apache.mahout.classifier.df.data.DataLoader.generateDataset(DataLoader.java:204)
>>      at
>> org.apache.mahout.classifier.df.tools.Describe.generateDataset(Describe.java:127)
>>      at
>> org.apache.mahout.classifier.df.tools.Describe.runTool(Describe.java:116)
>>      at
>> org.apache.mahout.classifier.df.tools.Describe.main(Describe.java:101)
>>      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>>


Re: Wrong number of attributes in the string

Posted by warren <wa...@gmail.com>.
thank you chyi-kwi
I checked my input data KDDtrain+.arrf
It's format no problem

@relation 'KDDTrain'
@attribute 'duration' real
@attribute 'protocol_type' {'tcp','udp', 'icmp'}
@attribute 'service' {'aol', 'auth', 'bgp', 'courier', 'csnet_ns', 
'ctf', 'daytime', 'discard', 'domain', 'domain_u', 'echo', 'eco_i', 
'ecr_i', 'efs', 'exec', 'finger', 'ftp', 'ftp_data', 'gopher', 
'harvest', 'hostnames', 'http', 'http_2784', 'http_443', 'http_8001', 
'imap4', 'IRC', 'iso_tsap', 'klogin', 'kshell', 'ldap', 'link', 'login', 
'mtp', 'name', 'netbios_dgm', 'netbios_ns', 'netbios_ssn', 'netstat', 
'nnsp', 'nntp', 'ntp_u', 'other', 'pm_dump', 'pop_2', 'pop_3', 
'printer', 'private', 'red_i', 'remote_job', 'rje', 'shell', 'smtp', 
'sql_net', 'ssh', 'sunrpc', 'supdup', 'systat', 'telnet', 'tftp_u', 
'tim_i', 'time', 'urh_i', 'urp_i', 'uucp', 'uucp_path', 'vmnet', 
'whois', 'X11', 'Z39_50'}
@attribute 'flag' { 'OTH', 'REJ', 'RSTO', 'RSTOS0', 'RSTR', 'S0', 'S1', 
'S2', 'S3', 'SF', 'SH' }
@attribute 'src_bytes' real
@attribute 'dst_bytes' real
@attribute 'land' {'0', '1'}
@attribute 'wrong_fragment' real
@attribute 'urgent' real
@attribute 'hot' real
@attribute 'num_failed_logins' real
@attribute 'logged_in' {'0', '1'}
@attribute 'num_compromised' real
@attribute 'root_shell' real
@attribute 'su_attempted' real
@attribute 'num_root' real
@attribute 'num_file_creations' real
@attribute 'num_shells' real
@attribute 'num_access_files' real
@attribute 'num_outbound_cmds' real
@attribute 'is_host_login' {'0', '1'}
@attribute 'is_guest_login' {'0', '1'}
@attribute 'count' real
@attribute 'srv_count' real
@attribute 'serror_rate' real
@attribute 'srv_serror_rate' real
@attribute 'rerror_rate' real
@attribute 'srv_rerror_rate' real
@attribute 'same_srv_rate' real
@attribute 'diff_srv_rate' real
@attribute 'srv_diff_host_rate' real
@attribute 'dst_host_count' real
@attribute 'dst_host_srv_count' real
@attribute 'dst_host_same_srv_rate' real
@attribute 'dst_host_diff_srv_rate' real
@attribute 'dst_host_same_src_port_rate' real
@attribute 'dst_host_srv_diff_host_rate' real
@attribute 'dst_host_serror_rate' real
@attribute 'dst_host_srv_serror_rate' real
@attribute 'dst_host_rerror_rate' real
@attribute 'dst_host_srv_rerror_rate' real
@attribute 'class' {'normal', 'anomaly'}
@data

Is there any other issues?

On 2012年08月14日 10:44, chyi-kwei yau wrote:
> Hi,
> I met this problem before.
> You need to check your input data format is the same as you describe in
> "-d N 3 C 2 N C 4 N C 8 N 2 C 19 N L"
>
> Best,
> Chyi-Kwei Yau
>
> On Mon, Aug 13, 2012 at 10:39 PM, warren <wa...@gmail.com> wrote:
>> Hi all ,I'm a beginner.
>>
>> when I try to run example : Partial Implementation
>>
>> I got a error as fellow,Is there anyone encountered the same problem?
>>
>> [warren@myhost ~]$ /opt/hadoop-1.0.0/bin/hadoop jar
>> $MAHOUT_HOME/core/target/mahout-core-0.8-SNAPSHOT-job.jar
>> org.apache.mahout.classifier.df.tools.Describe -p testdata/KDDTrain+.arff -f
>> testdata/KDDTrain+.info -d N 3 C 2 N C 4 N C 8 N 2 C 19 N L
>> Warning: $HADOOP_HOME is deprecated.
>>
>> 12/08/14 10:23:34 INFO tools.Describe: Generating the descriptor...
>> 12/08/14 10:23:35 INFO tools.Describe: generating the dataset...
>> Exception in thread "main" java.lang.IllegalArgumentException: Wrong number
>> of attributes in the string
>>      at
>> com.google.common.base.Preconditions.checkArgument(Preconditions.java:92)
>>      at
>> org.apache.mahout.classifier.df.data.DataLoader.parseString(DataLoader.java:67)
>>      at
>> org.apache.mahout.classifier.df.data.DataLoader.generateDataset(DataLoader.java:204)
>>      at
>> org.apache.mahout.classifier.df.tools.Describe.generateDataset(Describe.java:127)
>>      at
>> org.apache.mahout.classifier.df.tools.Describe.runTool(Describe.java:116)
>>      at
>> org.apache.mahout.classifier.df.tools.Describe.main(Describe.java:101)
>>      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>>


Re: Wrong number of attributes in the string

Posted by chyi-kwei yau <ch...@gmail.com>.
Hi,
I met this problem before.
You need to check your input data format is the same as you describe in
"-d N 3 C 2 N C 4 N C 8 N 2 C 19 N L"

Best,
Chyi-Kwei Yau

On Mon, Aug 13, 2012 at 10:39 PM, warren <wa...@gmail.com> wrote:
> Hi all ,I'm a beginner.
>
> when I try to run example : Partial Implementation
>
> I got a error as fellow,Is there anyone encountered the same problem?
>
> [warren@myhost ~]$ /opt/hadoop-1.0.0/bin/hadoop jar
> $MAHOUT_HOME/core/target/mahout-core-0.8-SNAPSHOT-job.jar
> org.apache.mahout.classifier.df.tools.Describe -p testdata/KDDTrain+.arff -f
> testdata/KDDTrain+.info -d N 3 C 2 N C 4 N C 8 N 2 C 19 N L
> Warning: $HADOOP_HOME is deprecated.
>
> 12/08/14 10:23:34 INFO tools.Describe: Generating the descriptor...
> 12/08/14 10:23:35 INFO tools.Describe: generating the dataset...
> Exception in thread "main" java.lang.IllegalArgumentException: Wrong number
> of attributes in the string
>     at
> com.google.common.base.Preconditions.checkArgument(Preconditions.java:92)
>     at
> org.apache.mahout.classifier.df.data.DataLoader.parseString(DataLoader.java:67)
>     at
> org.apache.mahout.classifier.df.data.DataLoader.generateDataset(DataLoader.java:204)
>     at
> org.apache.mahout.classifier.df.tools.Describe.generateDataset(Describe.java:127)
>     at
> org.apache.mahout.classifier.df.tools.Describe.runTool(Describe.java:116)
>     at
> org.apache.mahout.classifier.df.tools.Describe.main(Describe.java:101)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>