Re: [shogun] About CBinaryLabels and CMultilabelLabels

2017-05-29 Thread Tiramisu Ling
Thank you Heiko and Fernando! Sorry for the late reply. @Heiko But we
already have CLabels as base class of all other label classes. Do we need
to reconstruct to CLabels we have?

2017-05-30 1:59 GMT+08:00 Heiko Strathmann :

> Yes that's what I mean, just like we discussed for features in Zurich
>
> Not documented...
>
> H
>
> On Mon, 29 May 2017 at 11:52, Fernando J. Iglesias García <
> fernando.iglesi...@gmail.com> wrote:
>
>> @Heiko, I think this is a good idea. If I understand it correctly, you
>> suggest that the api has access to only one class for labels and then
>> Shogun (internally) figures out what label type (private for the api)
>> should be used (based on the input data, or in the learning algorithm once
>> they need to be used).
>>
>> Is this documented somewhere in github?
>>
>> On 29 May 2017 at 11:18, Heiko Strathmann 
>> wrote:
>>
>>> I suggest:
>>> - habe only one class for labels, CLabels, not abstract.
>>> -remove all other label classes
>>>
>>> Internally there might be more distinction, an impl class that is
>>> instantiated based on the passed input for example.
>>>
>>>
>>>
>>> On Mon, 29 May 2017 at 08:51, Tiramisu Ling 
>>> wrote:
>>>
 Thank you for your reply!

>
> Rather get rid of all classes for labels, offer a single one that
> transparently does all the conversions, and checks validity/range.


 Is that mean we should do the conversions inside CMultilabelLabels? Or
 we could make CBinaryLabels accept zero as value of label.

 2017-05-29 14:33 GMT+08:00 Heiko Strathmann :

> Please no new class!
> Rather get rid of all classes for labels, offer a single one that
> transparently does all the conversions, and checks validity/range.
>
> Zero sense in my eyes to have multiple classes for labels when we do
> runtime checks in the algorithms anyways.
>
> Also not templates please
>
> H
>
> On Mon, 29 May 2017 at 08:28, Tiramisu Ling 
> wrote:
>
>> Hi, I have a question about the difference between CBinaryLabels
>> and CMultilabelLabels. Why we need to make CBinaryLabels as {-1, 1} but
>> CMultilabelLabels define as {0,1...num_classs-1}? What about define
>> something like 'DigitalLabels' which can accept {-1, 0, 1, 
>> ...num_classes},
>> or just use CBinaryLabels as {0, 1}.
>>
>> Because we are going to Add global fixture with binary label data(issue
>> 3812 ),
>> and I add some code(the for loop part
>> )
>> to make it could work with multilclass data(comment
>> ).
>> But the problem is CBinaryLabels can only accept -1 or 1 but
>> CMultilabelLabels have 0,1 So I don't know how to generate two
>> different labels by *one *uniform process(don't need to distinguish
>> or specify which kind of label we want). And it seems like I can't cast
>> from one label to another directly.
>>
>> Please give me some help about that. Thank you very much!
>>
>> Best Regards,
>> MikeLing
>>
>>
>> --
> Sent from my phone
>

 --
>>> Sent from my phone
>>>
>>
>> --
> Sent from my phone
>


Re: [shogun] About CBinaryLabels and CMultilabelLabels

2017-05-29 Thread Heiko Strathmann
Yes that's what I mean, just like we discussed for features in Zurich

Not documented...

H
On Mon, 29 May 2017 at 11:52, Fernando J. Iglesias García <
fernando.iglesi...@gmail.com> wrote:

> @Heiko, I think this is a good idea. If I understand it correctly, you
> suggest that the api has access to only one class for labels and then
> Shogun (internally) figures out what label type (private for the api)
> should be used (based on the input data, or in the learning algorithm once
> they need to be used).
>
> Is this documented somewhere in github?
>
> On 29 May 2017 at 11:18, Heiko Strathmann 
> wrote:
>
>> I suggest:
>> - habe only one class for labels, CLabels, not abstract.
>> -remove all other label classes
>>
>> Internally there might be more distinction, an impl class that is
>> instantiated based on the passed input for example.
>>
>>
>>
>> On Mon, 29 May 2017 at 08:51, Tiramisu Ling  wrote:
>>
>>> Thank you for your reply!
>>>

 Rather get rid of all classes for labels, offer a single one that
 transparently does all the conversions, and checks validity/range.
>>>
>>>
>>> Is that mean we should do the conversions inside CMultilabelLabels? Or
>>> we could make CBinaryLabels accept zero as value of label.
>>>
>>> 2017-05-29 14:33 GMT+08:00 Heiko Strathmann 
>>> :
>>>
 Please no new class!
 Rather get rid of all classes for labels, offer a single one that
 transparently does all the conversions, and checks validity/range.

 Zero sense in my eyes to have multiple classes for labels when we do
 runtime checks in the algorithms anyways.

 Also not templates please

 H

 On Mon, 29 May 2017 at 08:28, Tiramisu Ling 
 wrote:

> Hi, I have a question about the difference between CBinaryLabels
> and CMultilabelLabels. Why we need to make CBinaryLabels as {-1, 1} but
> CMultilabelLabels define as {0,1...num_classs-1}? What about define
> something like 'DigitalLabels' which can accept {-1, 0, 1, 
> ...num_classes},
> or just use CBinaryLabels as {0, 1}.
>
> Because we are going to Add global fixture with binary label data(issue
> 3812 ), and
> I add some code(the for loop part
> )
> to make it could work with multilclass data(comment
> ).
> But the problem is CBinaryLabels can only accept -1 or 1 but
> CMultilabelLabels have 0,1 So I don't know how to generate two
> different labels by *one *uniform process(don't need to distinguish
> or specify which kind of label we want). And it seems like I can't cast
> from one label to another directly.
>
> Please give me some help about that. Thank you very much!
>
> Best Regards,
> MikeLing
>
>
> --
 Sent from my phone

>>>
>>> --
>> Sent from my phone
>>
>
> --
Sent from my phone


Re: [shogun] About CBinaryLabels and CMultilabelLabels

2017-05-29 Thread Fernando J . Iglesias García
@Heiko, I think this is a good idea. If I understand it correctly, you
suggest that the api has access to only one class for labels and then
Shogun (internally) figures out what label type (private for the api)
should be used (based on the input data, or in the learning algorithm once
they need to be used).

Is this documented somewhere in github?

On 29 May 2017 at 11:18, Heiko Strathmann 
wrote:

> I suggest:
> - habe only one class for labels, CLabels, not abstract.
> -remove all other label classes
>
> Internally there might be more distinction, an impl class that is
> instantiated based on the passed input for example.
>
>
>
> On Mon, 29 May 2017 at 08:51, Tiramisu Ling  wrote:
>
>> Thank you for your reply!
>>
>>>
>>> Rather get rid of all classes for labels, offer a single one that
>>> transparently does all the conversions, and checks validity/range.
>>
>>
>> Is that mean we should do the conversions inside CMultilabelLabels? Or
>> we could make CBinaryLabels accept zero as value of label.
>>
>> 2017-05-29 14:33 GMT+08:00 Heiko Strathmann :
>>
>>> Please no new class!
>>> Rather get rid of all classes for labels, offer a single one that
>>> transparently does all the conversions, and checks validity/range.
>>>
>>> Zero sense in my eyes to have multiple classes for labels when we do
>>> runtime checks in the algorithms anyways.
>>>
>>> Also not templates please
>>>
>>> H
>>>
>>> On Mon, 29 May 2017 at 08:28, Tiramisu Ling 
>>> wrote:
>>>
 Hi, I have a question about the difference between CBinaryLabels
 and CMultilabelLabels. Why we need to make CBinaryLabels as {-1, 1} but
 CMultilabelLabels define as {0,1...num_classs-1}? What about define
 something like 'DigitalLabels' which can accept {-1, 0, 1, ...num_classes},
 or just use CBinaryLabels as {0, 1}.

 Because we are going to Add global fixture with binary label data(issue
 3812 ), and
 I add some code(the for loop part
 )
 to make it could work with multilclass data(comment
 ).
 But the problem is CBinaryLabels can only accept -1 or 1 but
 CMultilabelLabels have 0,1 So I don't know how to generate two
 different labels by *one *uniform process(don't need to distinguish or
 specify which kind of label we want). And it seems like I can't cast from
 one label to another directly.

 Please give me some help about that. Thank you very much!

 Best Regards,
 MikeLing


 --
>>> Sent from my phone
>>>
>>
>> --
> Sent from my phone
>


Re: [shogun] About CBinaryLabels and CMultilabelLabels

2017-05-29 Thread Fernando J . Iglesias García
On 29 May 2017 at 08:27, Tiramisu Ling  wrote:

> Hi, I have a question about the difference between CBinaryLabels
> and CMultilabelLabels. Why we need to make CBinaryLabels as {-1, 1} but
> CMultilabelLabels define as {0,1...num_classs-1}? What about define
> something like 'DigitalLabels' which can accept {-1, 0, 1, ...num_classes},
> or just use CBinaryLabels as {0, 1}.
>

> Because we are going to Add global fixture with binary label data(issue
> 3812 ), and I
> add some code(the for loop part
> )
> to make it could work with multilclass data(comment
> ).
> But the problem is CBinaryLabels can only accept -1 or 1 but
> CMultilabelLabels have 0,1 So I don't know how to generate two
> different labels by *one *uniform process(don't need to distinguish or
> specify which kind of label we want). And it seems like I can't cast from
> one label to another directly.
>

I think the CBinaryLabels constructor with a threshold can help you to
create them from a vector of 0s and 1s:
https://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/labels/BinaryLabels.cpp#L52

For your understanding, the reason why binary labels take values on {-1, 1}
has probably to do with the fact that some binary classification algorithms
are formulated succinctly exploiting these values. For example, consider a
linear model with weight vector is w, bias b, the feature vector of data
sample i is x_i and its label l_i. Note that l_i can be either -1 or 1.
Learning could be expressed as,
   find awesome w and b
   subject to
 for all i, (w*x_i+b)l_i >= 0


>
> Please give me some help about that. Thank you very much!
>
> Best Regards,
> MikeLing
>
>
>


Re: [shogun] About CBinaryLabels and CMultilabelLabels

2017-05-29 Thread Heiko Strathmann
I suggest:
- habe only one class for labels, CLabels, not abstract.
-remove all other label classes

Internally there might be more distinction, an impl class that is
instantiated based on the passed input for example.



On Mon, 29 May 2017 at 08:51, Tiramisu Ling  wrote:

> Thank you for your reply!
>
>>
>> Rather get rid of all classes for labels, offer a single one that
>> transparently does all the conversions, and checks validity/range.
>
>
> Is that mean we should do the conversions inside CMultilabelLabels? Or we
> could make CBinaryLabels accept zero as value of label.
>
> 2017-05-29 14:33 GMT+08:00 Heiko Strathmann :
>
>> Please no new class!
>> Rather get rid of all classes for labels, offer a single one that
>> transparently does all the conversions, and checks validity/range.
>>
>> Zero sense in my eyes to have multiple classes for labels when we do
>> runtime checks in the algorithms anyways.
>>
>> Also not templates please
>>
>> H
>>
>> On Mon, 29 May 2017 at 08:28, Tiramisu Ling  wrote:
>>
>>> Hi, I have a question about the difference between CBinaryLabels
>>> and CMultilabelLabels. Why we need to make CBinaryLabels as {-1, 1} but
>>> CMultilabelLabels define as {0,1...num_classs-1}? What about define
>>> something like 'DigitalLabels' which can accept {-1, 0, 1, ...num_classes},
>>> or just use CBinaryLabels as {0, 1}.
>>>
>>> Because we are going to Add global fixture with binary label data(issue
>>> 3812 ), and I
>>> add some code(the for loop part
>>> )
>>> to make it could work with multilclass data(comment
>>> ).
>>> But the problem is CBinaryLabels can only accept -1 or 1 but
>>> CMultilabelLabels have 0,1 So I don't know how to generate two
>>> different labels by *one *uniform process(don't need to distinguish or
>>> specify which kind of label we want). And it seems like I can't cast from
>>> one label to another directly.
>>>
>>> Please give me some help about that. Thank you very much!
>>>
>>> Best Regards,
>>> MikeLing
>>>
>>>
>>> --
>> Sent from my phone
>>
>
> --
Sent from my phone


Re: [shogun] About CBinaryLabels and CMultilabelLabels

2017-05-29 Thread Tiramisu Ling
Thank you for your reply!
>
>
> Rather get rid of all classes for labels, offer a single one that
> transparently does all the conversions, and checks validity/range.


Is that mean we should do the conversions inside CMultilabelLabels? Or we
could make CBinaryLabels accept zero as value of label.

2017-05-29 14:33 GMT+08:00 Heiko Strathmann :

> Please no new class!
> Rather get rid of all classes for labels, offer a single one that
> transparently does all the conversions, and checks validity/range.
>
> Zero sense in my eyes to have multiple classes for labels when we do
> runtime checks in the algorithms anyways.
>
> Also not templates please
>
> H
>
> On Mon, 29 May 2017 at 08:28, Tiramisu Ling  wrote:
>
>> Hi, I have a question about the difference between CBinaryLabels
>> and CMultilabelLabels. Why we need to make CBinaryLabels as {-1, 1} but
>> CMultilabelLabels define as {0,1...num_classs-1}? What about define
>> something like 'DigitalLabels' which can accept {-1, 0, 1, ...num_classes},
>> or just use CBinaryLabels as {0, 1}.
>>
>> Because we are going to Add global fixture with binary label data(issue
>> 3812 ), and I
>> add some code(the for loop part
>> )
>> to make it could work with multilclass data(comment
>> ).
>> But the problem is CBinaryLabels can only accept -1 or 1 but
>> CMultilabelLabels have 0,1 So I don't know how to generate two
>> different labels by *one *uniform process(don't need to distinguish or
>> specify which kind of label we want). And it seems like I can't cast from
>> one label to another directly.
>>
>> Please give me some help about that. Thank you very much!
>>
>> Best Regards,
>> MikeLing
>>
>>
>> --
> Sent from my phone
>


Re: [shogun] About CBinaryLabels and CMultilabelLabels

2017-05-29 Thread Heiko Strathmann
Please no new class!
Rather get rid of all classes for labels, offer a single one that
transparently does all the conversions, and checks validity/range.

Zero sense in my eyes to have multiple classes for labels when we do
runtime checks in the algorithms anyways.

Also not templates please

H
On Mon, 29 May 2017 at 08:28, Tiramisu Ling  wrote:

> Hi, I have a question about the difference between CBinaryLabels
> and CMultilabelLabels. Why we need to make CBinaryLabels as {-1, 1} but
> CMultilabelLabels define as {0,1...num_classs-1}? What about define
> something like 'DigitalLabels' which can accept {-1, 0, 1, ...num_classes},
> or just use CBinaryLabels as {0, 1}.
>
> Because we are going to Add global fixture with binary label data(issue
> 3812 ), and I
> add some code(the for loop part
> )
> to make it could work with multilclass data(comment
> ).
> But the problem is CBinaryLabels can only accept -1 or 1 but
> CMultilabelLabels have 0,1 So I don't know how to generate two
> different labels by *one *uniform process(don't need to distinguish or
> specify which kind of label we want). And it seems like I can't cast from
> one label to another directly.
>
> Please give me some help about that. Thank you very much!
>
> Best Regards,
> MikeLing
>
>
> --
Sent from my phone