フィルターのクリア

Matlab fitnet function ignores some input variables that contain NaN values

6 ビュー (過去 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 Center および File ExchangeSpectral Estimation についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by