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

Un-observing in a Canopy

So, I'm messing around with a clustering problem where I want to move
items from cluster to cluster and maintain centroids. Lazy person that
I am, I am using the Canopy class. But it looks to me like I have to
recreate the Canopy when I pull something out. Have I missed anything?

Re: Un-observing in a Canopy

Posted by Lance Norskog <go...@gmail.com>.
Benson- if this works, please add it to the wiki.

Lance

On Sun, Mar 4, 2012 at 1:29 PM, Jeff Eastman <jd...@windwardsolutions.com> wrote:
> You can cause a canopy to un-observe a vector by observing it with a -1
> weight. This will have the effect of subtracting all influence of the vector
> on observations of that canopy. But you can only do that before you
> computeParameters, as all observation semantics is reset by that operation
> and converted to center and radius (mean & std).  But hmn, it might also
> work after computeParameters if you observe it with a weight of
>  -1/numObservations and computeParameters again. Double check the math on
> this.
>
>
> On 3/4/12 9:14 AM, Paritosh Ranjan wrote:
>>
>> There is a way to recalculate the parameters, as I already mentioned
>>
>> canopy.computeParameters(),
>>
>>
>> but I can not find any way to un-observe a Canopy.
>>
>> On 04-03-2012 19:58, Benson Margulies wrote:
>>>
>>> On Sun, Mar 4, 2012 at 9:10 AM, Paritosh Ranjan<pr...@xebia.com>
>>>  wrote:
>>>>
>>>> Not sure whether I got your question correctly.
>>>> Are you looking for canopy.computeParameters().
>>>
>>> 'observe' adds an item to the cluster for which Canopy is calculating
>>> parameters when asked.
>>>
>>> I'm just confirming that there's no way to 'subtract' an item and
>>> recalculate the parameters.
>>>
>>>
>>>>
>>>> On 04-03-2012 05:09, Benson Margulies wrote:
>>>>>
>>>>> So, I'm messing around with a clustering problem where I want to move
>>>>> items from cluster to cluster and maintain centroids. Lazy person that
>>>>> I am, I am using the Canopy class. But it looks to me like I have to
>>>>> recreate the Canopy when I pull something out. Have I missed anything?
>>>>
>>>>
>>
>>
>>
>



-- 
Lance Norskog
goksron@gmail.com

Re: Un-observing in a Canopy

Posted by Jeff Eastman <jd...@windwardsolutions.com>.
You can cause a canopy to un-observe a vector by observing it with a -1 
weight. This will have the effect of subtracting all influence of the 
vector on observations of that canopy. But you can only do that before 
you computeParameters, as all observation semantics is reset by that 
operation and converted to center and radius (mean & std).  But hmn, it 
might also work after computeParameters if you observe it with a weight 
of  -1/numObservations and computeParameters again. Double check the 
math on this.

On 3/4/12 9:14 AM, Paritosh Ranjan wrote:
> There is a way to recalculate the parameters, as I already mentioned
>
> canopy.computeParameters(),
>
>
> but I can not find any way to un-observe a Canopy.
>
> On 04-03-2012 19:58, Benson Margulies wrote:
>> On Sun, Mar 4, 2012 at 9:10 AM, Paritosh Ranjan<pr...@xebia.com>  
>> wrote:
>>> Not sure whether I got your question correctly.
>>> Are you looking for canopy.computeParameters().
>> 'observe' adds an item to the cluster for which Canopy is calculating
>> parameters when asked.
>>
>> I'm just confirming that there's no way to 'subtract' an item and
>> recalculate the parameters.
>>
>>
>>>
>>> On 04-03-2012 05:09, Benson Margulies wrote:
>>>> So, I'm messing around with a clustering problem where I want to move
>>>> items from cluster to cluster and maintain centroids. Lazy person that
>>>> I am, I am using the Canopy class. But it looks to me like I have to
>>>> recreate the Canopy when I pull something out. Have I missed anything?
>>>
>
>
>


Re: Un-observing in a Canopy

Posted by Paritosh Ranjan <pr...@xebia.com>.
There is a way to recalculate the parameters, as I already mentioned

canopy.computeParameters(),


but I can not find any way to un-observe a Canopy.

On 04-03-2012 19:58, Benson Margulies wrote:
> On Sun, Mar 4, 2012 at 9:10 AM, Paritosh Ranjan<pr...@xebia.com>  wrote:
>> Not sure whether I got your question correctly.
>> Are you looking for canopy.computeParameters().
> 'observe' adds an item to the cluster for which Canopy is calculating
> parameters when asked.
>
> I'm just confirming that there's no way to 'subtract' an item and
> recalculate the parameters.
>
>
>>
>> On 04-03-2012 05:09, Benson Margulies wrote:
>>> So, I'm messing around with a clustering problem where I want to move
>>> items from cluster to cluster and maintain centroids. Lazy person that
>>> I am, I am using the Canopy class. But it looks to me like I have to
>>> recreate the Canopy when I pull something out. Have I missed anything?
>>


Re: Un-observing in a Canopy

Posted by Benson Margulies <bi...@gmail.com>.
On Sun, Mar 4, 2012 at 9:10 AM, Paritosh Ranjan <pr...@xebia.com> wrote:
> Not sure whether I got your question correctly.
> Are you looking for canopy.computeParameters().

'observe' adds an item to the cluster for which Canopy is calculating
parameters when asked.

I'm just confirming that there's no way to 'subtract' an item and
recalculate the parameters.


>
>
> On 04-03-2012 05:09, Benson Margulies wrote:
>>
>> So, I'm messing around with a clustering problem where I want to move
>> items from cluster to cluster and maintain centroids. Lazy person that
>> I am, I am using the Canopy class. But it looks to me like I have to
>> recreate the Canopy when I pull something out. Have I missed anything?
>
>

Re: Un-observing in a Canopy

Posted by Paritosh Ranjan <pr...@xebia.com>.
Not sure whether I got your question correctly.
Are you looking for canopy.computeParameters().

On 04-03-2012 05:09, Benson Margulies wrote:
> So, I'm messing around with a clustering problem where I want to move
> items from cluster to cluster and maintain centroids. Lazy person that
> I am, I am using the Canopy class. But it looks to me like I have to
> recreate the Canopy when I pull something out. Have I missed anything?