Grouping similar labels

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Grouping similar labels

Pierre DEMAJ

Dear Weka experts,

 

I am using a .arff that looks like this:

 

0.562,-0.90659,4.717,Class.1

1.762,-0.69157,3.022,Class.1

0.222,-0.2993,2.147,Class.1

-1.435,-1.15904,3.751,Class.2

-2.029,-0.22442,3.424,Class.2

-0.331,0.65621,6.292,Class.2

-2.242,-0.12325,3.294,Class.3

-3.57,0.12794,5.052,Class.3

-2.263,0.14772,3.362,Class.3

-4.604,-0.71211,1.574,Class.3

-1.722,-0.71604,5.424,Class.1

-6.149,-0.43472,-1.944,Class.1

-6.197,-0.22146,-2.302,Class.1

-2.231,-1.1015,0.839,Class.2

-3.172,-0.36353,1.795,Class.2

-1.799,-0.93137,0.663,Class.2

 

I would like to group vectors of same classes without random permutation, so that the output arff looks like this:

 

0.562,-0.90659,4.717,Class.1

1.762,-0.69157,3.022,Class.1

0.222,-0.2993,2.147,Class.1

-1.722,-0.71604,5.424,Class.1

-6.149,-0.43472,-1.944,Class.1

-6.197,-0.22146,-2.302,Class.1

-1.435,-1.15904,3.751,Class.2

-2.029,-0.22442,3.424,Class.2

-0.331,0.65621,6.292,Class.2

-2.231,-1.1015,0.839,Class.2

-3.172,-0.36353,1.795,Class.2

-1.799,-0.93137,0.663,Class.2

-2.242,-0.12325,3.294,Class.3

-3.57,0.12794,5.052,Class.3

-2.263,0.14772,3.362,Class.3

-4.604,-0.71211,1.574,Class.3

 

Is there any Weka function that implement this ?

 

Thanks in advance for your help.

Pierre


_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Grouping similar labels

Eibe Frank-2
Administrator
In the Explorer, you can sort by column value in the dataset editor (click “Edit…” in the Preprocess panel).

In the KnowledgeFlow, there is the “Sorter” component, under “Tools”.

A (hacky) way that works in all user interfaces is to use the supervised version of the Resample filter. A command-line example:

  java weka.Run .supervised.instance.Resample -no-replacement -c last < ~/datasets/UCI/optdigits.arff

Cheers,
Eibe

> On 14/06/2017, at 1:39 AM, Pierre DEMAJ <[hidden email]> wrote:
>
> Dear Weka experts,
>  
> I am using a .arff that looks like this:
>  
> 0.562,-0.90659,4.717,Class.1
> 1.762,-0.69157,3.022,Class.1
> 0.222,-0.2993,2.147,Class.1
> -1.435,-1.15904,3.751,Class.2
> -2.029,-0.22442,3.424,Class.2
> -0.331,0.65621,6.292,Class.2
> -2.242,-0.12325,3.294,Class.3
> -3.57,0.12794,5.052,Class.3
> -2.263,0.14772,3.362,Class.3
> -4.604,-0.71211,1.574,Class.3
> -1.722,-0.71604,5.424,Class.1
> -6.149,-0.43472,-1.944,Class.1
> -6.197,-0.22146,-2.302,Class.1
> -2.231,-1.1015,0.839,Class.2
> -3.172,-0.36353,1.795,Class.2
> -1.799,-0.93137,0.663,Class.2
>  
> I would like to group vectors of same classes without random permutation, so that the output arff looks like this:
>  
> 0.562,-0.90659,4.717,Class.1
> 1.762,-0.69157,3.022,Class.1
> 0.222,-0.2993,2.147,Class.1
> -1.722,-0.71604,5.424,Class.1
> -6.149,-0.43472,-1.944,Class.1
> -6.197,-0.22146,-2.302,Class.1
> -1.435,-1.15904,3.751,Class.2
> -2.029,-0.22442,3.424,Class.2
> -0.331,0.65621,6.292,Class.2
> -2.231,-1.1015,0.839,Class.2
> -3.172,-0.36353,1.795,Class.2
> -1.799,-0.93137,0.663,Class.2
> -2.242,-0.12325,3.294,Class.3
> -3.57,0.12794,5.052,Class.3
> -2.263,0.14772,3.362,Class.3
> -4.604,-0.71211,1.574,Class.3
>  
> Is there any Weka function that implement this ?
>  
> Thanks in advance for your help.
> Pierre
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html