Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Issue with Feature Normalization Macro? How to normalize with python?

hydrogurl01
8 - Asteroid

Hi everyone,

 

I'm attempting to use the Feature Normalization macro that is on the Gallery found here:

https://gallery.alteryx.com/#!app/Feature-Normalization/5931ca6aeffc2a0b7cc53eb2

@KevinMcCoy 

 

However, when I connect it to my input file - I don't see any fields to select from for me to normalize as shown in screenshot below:

 

hydrogurl01_0-1604357723128.png

 

At first I thought this was due to my input being a .csv file, so I converted it to a .yxdb but I'm facing the same issue. Does anyone know what the issue here is?

 

Also - I saw in the Feature Normalization How To article that there is a way to input python code to do the normalization right in Alteryx. I'm not very familiar with python - but would I just use the python in Alteryx and paste the code provided in the article right into it? How would I define which fields I want it to normalize with the code?

 

Thanks in advance!

 

 

Update: Realized that my fields were all in V_String format and that's why I didn't see any fields popping up in the macro! However, I am still confused on how to normalize using the Python method (using the Python tool in Alteryx). If someone can please provide detail on how to do that so I can compare both the macro and the Python method, that would be great! 

1 REPLY 1
damc
11 - Bolide

Hello @hydrogurl01 

 

In order to use the Python code mentioned in the article you can just paste it on the notebook
provided by the Python tool. I´ve attached an example workflow and here are a few things to consider:

 

Please note that the Python´s MinMaxScaler method only accepts numerical values, so I´d suggest you to use a Select tool to choose only the numerical fields you need to normalize, otherwise you´ll get an error.

 

Also, it´s worth noting that the macro and the article´s code use two different approaches to normalize the data: while the macro is doing a Z normalization (or Standardization),the code is doing a min-max normalization. (this article provides a concise explanation of both methods: https://towardsdatascience.com/understand-data-normalization-in-machine-learning-8ff3062101f0)

 

If you want to compare the results, I´d suggest you to replace the MinMaxScaler method by the StandardScaler, then the macro and the code will output simillar results, as they´re using the same approach.

 

Hope it helps

 

Regards

Labels