Skip to main content
Solved

Get the difference between each feature value (small dataset)

  • July 11, 2019
  • 4 replies
  • 103 views

jnotter
Contributor
Forum|alt.badge.img+5

I want to take a small data set like the one below and calculate the difference between each feature as either a matrix or as a 1:1 readout

Input

Matrix output

Paired output

the goal would be then to use this data to evaluate a matrix of points to determine their proximity in relationship of the nodes for the given point

Best answer by ebygomm

Either option is possible.

 

The matrix option is a bit more complicated as would either require amending to expose the node names as attributes or doing this dynamically. What format would you want to write back to.

I've attached a quick example

difference_between_features.fmwt

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.

4 replies

fmelizard
Safer
Forum|alt.badge.img+20
  • Safer
  • 3719 replies
  • July 16, 2019

Hi @jnotter The FeatureJoiner is great for comparing features together. I'd also recommend renaming the attributes for the Left or Right port. See https://hub.safe.com/publishers/safe-lab/templates/pair-every-feature for reference.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • Best Answer
  • July 17, 2019

Either option is possible.

 

The matrix option is a bit more complicated as would either require amending to expose the node names as attributes or doing this dynamically. What format would you want to write back to.

I've attached a quick example

difference_between_features.fmwt


jnotter
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 18 replies
  • July 26, 2019

Either option is possible.

 

The matrix option is a bit more complicated as would either require amending to expose the node names as attributes or doing this dynamically. What format would you want to write back to.

I've attached a quick example

difference_between_features.fmwt

I couldn't tell from the transformers how you made the Cartesian join successful, but your FMWT worked as designed once I made my input match your input structure.


jnotter
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 18 replies
  • July 29, 2019

Hi @jnotter The FeatureJoiner is great for comparing features together. I'd also recommend renaming the attributes for the Left or Right port. See https://hub.safe.com/publishers/safe-lab/templates/pair-every-feature for reference.

Feature Joiner requires a "Join On" criteria. Essentially this needs a Cartesian join, and thus why the dataset must remain small in order for this to work.