Skip to main content
Best Answer

loop in custom transformer or conditional values?

  • April 30, 2020
  • 8 replies
  • 47 views

jonathanklarup
Contributor
Forum|alt.badge.img+6

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 :)
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

redgeographics
Celebrity
Forum|alt.badge.img+62

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.


jonathanklarup
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • April 30, 2020

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

jonathanklarup
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • April 30, 2020

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?

jonathanklarup
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • Best Answer
  • April 30, 2020

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

jonathanklarup
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • April 30, 2020

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

jonathanklarup
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • April 30, 2020

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+62

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.


jonathanklarup
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • April 30, 2020

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