HealthCatalyst / healthcareai-r

R tools for healthcare machine learning
https://docs.healthcare.ai
Other
245 stars 106 forks source link

Remove columns with near zero varience before center/scale step in prep_data #1244

Open NateGarrettHC opened 6 years ago

NateGarrettHC commented 6 years ago

Whenever a column has only one value, when it gets centered and scaled, the step converts that column to all NAs. And if NAs are fed into the PCA step, it fails. Removing near zero variance columns before centering and scaling would fix this.