필터 지우기
필터 지우기

Normalize specific data in a table

조회 수: 3 (최근 30일)
Joe Sun
Joe Sun 2017년 5월 22일
댓글: atiqah ghaffar 2018년 12월 5일
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)

채택된 답변

Guillaume
Guillaume 2017년 5월 22일
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
Joe Sun
Joe Sun 2017년 5월 22일
Thank you very much! It is great! I can continue my working now, thank you again
atiqah ghaffar
atiqah ghaffar 2018년 12월 5일
Thank you! i've been working this for too long now i can proceed to the next step. Thank you :')

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by