how does glm / lassoglm treat NaN's - how do they avoid them ?
5 ビュー (過去 30 日間)
古いコメントを表示
i understand that the lassoglm and glm function ignore the NaNs or the absence of data and still generate models. How do they avoid these missing values - do they convert NaNs into zeros ? or is it some other method.
I tried reading the source code for that function - but couldn't understand much
0 件のコメント
回答 (1 件)
Rajesh Balagam
2017 年 9 月 18 日
If you are referring to "glmfit" function, it is mentioned in the corresponding documentation page that "glmfit treats NaNs in either X or y as missing values, and ignores them."
Based on the MATLAB code in glmfit.m file, it is calling an internal function "statremovenan". You can also use "isfinite" function to find the indices of the data that are not finite (returns true for finite data and false for other values) and ignore them for further processing.
2 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!