Solved

loop in custom transformer or conditional values?

  • 30 April 2020
  • 8 replies
  • 5 views

Badge

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.
icon

Best answer by jonathanklarup 30 April 2020, 12:30

View original

8 replies

Userlevel 5
Badge +26

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.

Badge

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..
Badge

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?
Badge

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 :)
Badge

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 :)
Badge

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 ...

Userlevel 5
Badge +26

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.

Badge

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 :)

Reply