[問題類型]:
程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來)
[軟體熟悉度]:
請把以下不需要的部份刪除
新手(沒寫過程式,R 是我的第一次)
[問題敘述]:
想要訓練一個高維度資料的Logistic迴歸模型,但是在後面的特徵卻都出現NA
就是summary之後對於個特徵如下面的圖,這是因為glm沒辦法處理太多特徵?
https://goo.gl/aJJNca
[程式範例]:
train_sample<-sample(40,30)
train_data<-temp[train_sample,]
test_data<-temp[-train_sample,]
model<-glm(type~.,family=binomial,data=train_data)
[環境敘述]:
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=zh_TW.UTF-8 LC_NUMERIC=C LC_TIME=zh_TW.UTF-8
[4] LC_COLLATE=zh_TW.UTF-8 LC_MONETARY=zh_TW.UTF-8 LC_MESSAGES=zh_TW.UTF-8
[7] LC_PAPER=zh_TW.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=zh_TW.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ROCR_1.0-7 gplots_3.0.1
loaded via a namespace (and not attached):
[1] compiler_3.4.0 class_7.3-14 tools_3.4.0 KernSmooth_2.23-15 gdata_2.18.0
[6] caTools_1.17.1 bitops_1.0-6 gtools_3.5.0
[關鍵字]:
選擇性,也許未來有用