필터 지우기
필터 지우기

Matlab fitnet function ignores some input variables that contain NaN values

조회 수: 4 (최근 30일)
Jorge
Jorge 2024년 3월 21일
답변: MULI 2024년 6월 20일
Matlab fitnet function ignores some input variables that contain NaN values.
My input layer contains some points with NaN values. I am aware that fitnet will not handle NaN values. However, when I get the input weights (IW) from the network with ten predictors, the input weights matrix eliminates two predictors and I don't know which ones.

답변 (1개)

MULI
MULI 2024년 6월 20일
Hi Jorge,
I understand that you are experiencing an issue in training the model due to NaN values.
Following steps helps in addressing the issue:
Step 1: Identify NaN-containing predictors
Before feeding your data into the fitnet function, check which predictors contain NaN values using MATLAB functions like “isnan”.
Step 2: Handling NaN Values
Once you have identified the columns with NaNs, you can:
Remove NaNs: If only a few rows contain NaNs, you might choose to remove those rows.
Imputation: Replace NaN values with some form of imputation. Common strategies include using the mean, median, or mode of the column.
Step 3: Re-check Input Weights Matrix
After handling NaN values, retrain your network using fitnet and check the input weights matrix again. Now, it should consider all predictors since none of them contain NaNs.
You may refer this documentation link for more information on “isnan” function
You may also refer this link for more information in handling NaN values in the training data set.
Hope this answers your query!

카테고리

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

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by