필터 지우기
필터 지우기

Change variables for regression to use it as dummies

조회 수: 1 (최근 30일)
Max
Max 2022년 8월 26일
댓글: dpb 2022년 8월 26일
I would like to change the datas to 0 and 1.
Anything between 0 to 30% will be 0 and anything over 30 should be 1.
Does someone has a script to change it ?
Thats my code to change it into a vertical order (changed the name from Board Gender Diversity to mBoardGenDiv):
mBoardGenDiv = mBoardGenDiv(:,[1:end]);
mBoardGenDiv = mBoardGenDiv(:);
Thanks in advance!
  댓글 수: 1
dpb
dpb 2022년 8월 26일
That's trivial use of <Logical Indexing> in MATLAB
mBoardGenDiv=BoardGenderDiversity(BoardGenderDiversity>30);

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by