문제

I have a query in relation to Sparse Arff in weka->

An example shown below:

@RELATION example

@ATTRIBUTE an apple
@ATTRIBUTE a cat
@ATTRIBUTE for love
@ATTRIBUTE the end

@ATTRIBUTE class {real, fake}

@DATA

Here is my query:
This is very straightforward->
0,1,0,0,real -> {1 1, 4 real}
0,0,0,1,fake -> {3 1, 4 fake}
But how to write this ones->
1,1,1,1,real -> ? I need help here
2,1,3,1,fake -> ? I need help here

Thanks in advance guys.

Best Regards plasma33

도움이 되었습니까?

해결책

You can run the NonSparseToSparse filter and check the results. In your case, from:

@RELATION example

@ATTRIBUTE an numeric
@ATTRIBUTE a numeric
@ATTRIBUTE for numeric
@ATTRIBUTE the numeric

@ATTRIBUTE class {real, fake}

@DATA
0,1,0,0,real
0,0,0,1,fake
1,1,1,1,real
2,1,3,1,fake

You get:

@relation example-weka.filters.unsupervised.instance.NonSparseToSparse

@attribute an numeric
@attribute a numeric
@attribute for numeric
@attribute the numeric
@attribute class {real,fake}

@data
{1 1}
{3 1,4 fake}
{0 1,1 1,2 1,3 1}
{0 2,1 1,2 3,3 1,4 fake}

Please note that real is the default value and in nominal attributes, it is not print in sparse format. Please note as well that the first index is 0.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top