Borrar filtros
Borrar filtros

Normalize specific data in a table

3 visualizaciones (últimos 30 días)
Joe Sun
Joe Sun el 22 de Mayo de 2017
Comentada: atiqah ghaffar el 5 de Dic. de 2018
I have a set of data (call it 'dataset') which is 20*20 table(actually it is very large). I have converted the table to be matrix and used 'normc' function to do the normalization (preprocessing). My question is normc change all the value of the whole dataset, but the first and the last column is the ID and predict output of the dataset, they should not be change. How can I normalize data without changing the first and last column?(I'm a matlab beginner)

Respuesta aceptada

Guillaume
Guillaume el 22 de Mayo de 2017
You can work directly on the table using, for example, varfun:
yourtable(:, 2:end) = varfun(@normc, yourtable, 'InputVariables', 2:width(yourtable)) %normalise every column but first.
Or using simple indexing, convert only the portion you want to a matrix and store back into the table:
yourtable{:, 2:end} = normc(yourtable{:, 2:end}) %normalise everything but 1st column
  2 comentarios
Joe Sun
Joe Sun el 22 de Mayo de 2017
Thank you very much! It is great! I can continue my working now, thank you again
atiqah ghaffar
atiqah ghaffar el 5 de Dic. de 2018
Thank you! i've been working this for too long now i can proceed to the next step. Thank you :')

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by