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