How to normalize data set in MATLAB. If it is csv file .

I want to train my Extreme Learning Machine. but data set should be normalized between -1 to 1.My data set is csv file.i want to know how to normalize csv file.I read the question asked by others but it didn't work.please help.

1 commentaire

Jan
Jan le 26 Avr 2017
"It didn't work" is not a useful description of your problems. Please post your code and post a complete copy of the error message. How could we suggest an improvement, when we have to guess, what the problem is?

Connectez-vous pour commenter.

 Réponse acceptée

Jan
Jan le 26 Avr 2017
Modifié(e) : Jan le 26 Avr 2017
You cannot normalize a file. You have to import the data at first, most likely by csvread or readtable. Then the normalization should be exactly as shown in many otehr threads:
Data = rand(10, 20); % Test data, use your data instead
minData = min(Data(:));
maxData = max(Data(:));
scaled = (Data - minData) / (maxData - minData); % Scaled to [0, 1]
scaled = scaled * 2 - 1; % Scaled to [-1, 1]

6 commentaires

tejasvee
tejasvee le 26 Avr 2017
Modifié(e) : tejasvee le 26 Avr 2017
Thank you for reply.One more query if i want to use that normalized data set for training my machine where i can found that file or how i can use that normalized data set for training? without using this normalizing code in my machine code.
Jan
Jan le 26 Avr 2017
I do not understand the question. Perhaps you want to save the data after the normalization to a file again?
Yes, i want to save the data after normalization to a file again. So that i can use it in my program in normalized form.
Jan
Jan le 28 Avr 2017
Then use csvwrite or save.
Chris
Chris le 11 Août 2023
This doesn't work. It says Error using " / " Arguments must be numeric, char or logical. Even though the data i used is a numeric data.
It sounds as if you might have a table() object instead of a numeric array.
ExistingVars = YourTable.Properties.VariableNames;
NewTable = varfun(YourTable, @(V)rescale(V,-1,1), 'InputVariables', @isnumeric );
NewTable.Properties.Variablenames = ExistingVars;

Connectez-vous pour commenter.

Plus de réponses (1)

temeraire007
temeraire007 le 11 Fév 2024

0 votes

There are also a couple of tools you can use. I have to do this kind of data cleaning on a monthly basis as our CRM is just completely useless. The tools are not perfect by any means, but for me for large files like +5K data entries saved some time.
OpenRefine (will have to download the tool but its really powerful to automate)
DataNormalizer (Online solution, so no need to download anything, got quiet good results quickly)
TableAnalyzer (tool from Microsoft but I think only works for MicrosoftAccess)

Catégories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by