Skip to main content
Solved

loop in custom transformer or conditional values?


Forum|alt.badge.img

I have a dataset containing 100000 points, for these points I've calulated 700 neighborhood. Now I want to calculate the z score for every point in each individual neighborhood.

 

 

My question is: is there an easier way to do it, than 700 conditional values ?

 

I've tried with a custom transformer in which I can loop, but I cannot get my head around how to do it.

 

 

 

Please help :)

 

Thanks in advance.

Best answer by jonathanklarup

https://knowledge.safe.com/questions/78585/how-to-add-group-by-to-any-transformer.html

 

 

Found it here, so if I put the z-score into a custom transformer I can make a group by parameter which solves the issue :)
View original
Did this help you find an answer to your question?

8 replies

redgeographics
Celebrity
Forum|alt.badge.img+50

How exactly are you going to calculate the z-score? If it can be expressed in a single formula I don't think looping or conditional values are even necessary.

700 conditional values are most likely not the way to go by the way, that'll be hell to set up and maintain.


Forum|alt.badge.img
redgeographics wrote:

How exactly are you going to calculate the z-score? If it can be expressed in a single formula I don't think looping or conditional values are even necessary.

700 conditional values are most likely not the way to go by the way, that'll be hell to set up and maintain.

I calculate the standard deviation and mean with the statistics calculator, and group it by the neighborhood id, then i have the formula in the attributecreator for the z score.

 

Which i'd like to have in like a for loop: for x in neighborhood : calculate z..

Forum|alt.badge.img
redgeographics wrote:

How exactly are you going to calculate the z-score? If it can be expressed in a single formula I don't think looping or conditional values are even necessary.

700 conditional values are most likely not the way to go by the way, that'll be hell to set up and maintain.

Is it possible to group data by id in attribute manager or attribute creator?

Forum|alt.badge.img

https://knowledge.safe.com/questions/78585/how-to-add-group-by-to-any-transformer.html

 

 

Found it here, so if I put the z-score into a custom transformer I can make a group by parameter which solves the issue :)

Forum|alt.badge.img
redgeographics wrote:

How exactly are you going to calculate the z-score? If it can be expressed in a single formula I don't think looping or conditional values are even necessary.

700 conditional values are most likely not the way to go by the way, that'll be hell to set up and maintain.

https://knowledge.safe.com/questions/78585/how-to-add-group-by-to-any-transformer.html

 

 

Found it here, so if I put the z-score into a custom transformer I can make a group by parameter which solves the issue :)

Forum|alt.badge.img
jonathanklarup wrote:

https://knowledge.safe.com/questions/78585/how-to-add-group-by-to-any-transformer.html

 

 

Found it here, so if I put the z-score into a custom transformer I can make a group by parameter which solves the issue :)

Must have forgotten this part of the advanced course ...


redgeographics
Celebrity
Forum|alt.badge.img+50
jonathanklarup wrote:

https://knowledge.safe.com/questions/78585/how-to-add-group-by-to-any-transformer.html

 

 

Found it here, so if I put the z-score into a custom transformer I can make a group by parameter which solves the issue :)

I honestly don't think you even need to group by, the AttributeCreator works feature-by-feature.


Forum|alt.badge.img
redgeographics wrote:

I honestly don't think you even need to group by, the AttributeCreator works feature-by-feature.

You are completely right. I might have over thinked it .. but GREAT Thanks a lot :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings