Feature Selection

Feature Selection

Ensemble Learning
  • bagging method and boosting method
Bagging
  • sampling with replacement
  • decrease variance by introducing randomness into your model framework
  • random forest = bagging + decision tree
Random Forest
  • description of random forest
    there are n samples with m features in the training data
    • take n observations with replacement each time 行上有放回的抽樣
    • in these n observations, take k features (k < m) to calculate a best decision tree 列上抽樣不放回
    • repeat the below steps for several times, combine all the decision tree to a random forest
  • features:
    • decrease variance by introducing randomness into the model framework
    • the destributions of each n observations are the same as the original training data
    • we don't need to do pruning for each "weak" decision tree
    • less overfitting
    • parallel implementation
  • Feature Importance value in Random Forest
    importance(i) = performance(RF) - performance(RF^{random \,i})(advance topic: out of bag evaluation)
    how to define performance? let the column of the feature be a list of random numbers and calculate the output by the model, get the loss
    • not negative nor positive, just show how much a special feature influences the model
Support Vector Machine
  • SVM: maximize the minimum margin


    image.png

    image.png

    if not linear, add noise factors into the equation to map it to a higher dimension space, applying kernel function
    image.png
Why Feature Selection?
  • reduce overfitting
  • better understanding your model
  • improve model stability (i.e. improve generalization)
    取決于你想要做什么渊额,如果是做一個調(diào)查,想研究每一個feature的貢獻(xiàn),則需要刪除一些data以減少相關(guān)性太大的features對模型的影響;如果想要做prediction,則只關(guān)心結(jié)果是否準(zhǔn)確痊硕,不太需要刪除features。模型穩(wěn)定性差:某一個feature變化一點點而導(dǎo)致系數(shù)變化特別大,說明模型不穩(wěn)定variance特別大盟萨,原因可能是model特別復(fù)雜或者相關(guān)性features太多。解決辦法最直觀的:regularization
Pearson Correlation

to measrue linear dependency between features
\rho_{x_1, x_2} = \frac{ cov(x_1, x_2) }{\sigma x_1 \sigma x_2}

  • cov(x_1, x_2)means covariance and \sigma means standard deviation
  • covariance:
    cov(x_1, x_2) = E[(x_1 - E(x_2))(x_2 - E(x_1))] = E(x_1x_2) - E(x_1)E(x_2) where \sigma x_1^2 = E(x_1^2) - E(x_1)^2
Regularization Models

L1 tends to provide sparse solution
L2 tends to spread out more equality

for example:
image.png
Principal Component Analysis
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末了讨,一起剝皮案震驚了整個濱河市捻激,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌前计,老刑警劉巖胞谭,帶你破解...
    沈念sama閱讀 216,372評論 6 498
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異男杈,居然都是意外死亡丈屹,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,368評論 3 392
  • 文/潘曉璐 我一進(jìn)店門势就,熙熙樓的掌柜王于貴愁眉苦臉地迎上來泉瞻,“玉大人脉漏,你說我怎么就攤上這事⌒溲溃” “怎么了侧巨?”我有些...
    開封第一講書人閱讀 162,415評論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長鞭达。 經(jīng)常有香客問我司忱,道長,這世上最難降的妖魔是什么畴蹭? 我笑而不...
    開封第一講書人閱讀 58,157評論 1 292
  • 正文 為了忘掉前任坦仍,我火速辦了婚禮,結(jié)果婚禮上叨襟,老公的妹妹穿的比我還像新娘繁扎。我一直安慰自己,他們只是感情好糊闽,可當(dāng)我...
    茶點故事閱讀 67,171評論 6 388
  • 文/花漫 我一把揭開白布梳玫。 她就那樣靜靜地躺著,像睡著了一般右犹。 火紅的嫁衣襯著肌膚如雪提澎。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,125評論 1 297
  • 那天念链,我揣著相機(jī)與錄音盼忌,去河邊找鬼。 笑死掂墓,一個胖子當(dāng)著我的面吹牛谦纱,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播梆暮,決...
    沈念sama閱讀 40,028評論 3 417
  • 文/蒼蘭香墨 我猛地睜開眼服协,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了啦粹?” 一聲冷哼從身側(cè)響起偿荷,我...
    開封第一講書人閱讀 38,887評論 0 274
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎唠椭,沒想到半個月后跳纳,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,310評論 1 310
  • 正文 獨居荒郊野嶺守林人離奇死亡贪嫂,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,533評論 2 332
  • 正文 我和宋清朗相戀三年寺庄,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 39,690評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡斗塘,死狀恐怖赢织,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情馍盟,我是刑警寧澤于置,帶...
    沈念sama閱讀 35,411評論 5 343
  • 正文 年R本政府宣布,位于F島的核電站贞岭,受9級特大地震影響八毯,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜瞄桨,卻給世界環(huán)境...
    茶點故事閱讀 41,004評論 3 325
  • 文/蒙蒙 一话速、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧芯侥,春花似錦泊交、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,659評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽雏婶。三九已至物赶,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間留晚,已是汗流浹背酵紫。 一陣腳步聲響...
    開封第一講書人閱讀 32,812評論 1 268
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點兒被人妖公主榨干…… 1. 我叫王不留错维,地道東北人奖地。 一個月前我還...
    沈念sama閱讀 47,693評論 2 368
  • 正文 我出身青樓,卻偏偏與公主長得像赋焕,于是被迫代替她去往敵國和親参歹。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,577評論 2 353

推薦閱讀更多精彩內(nèi)容

  • 如果有一天隆判,我們在一起犬庇,我會將我生命中最開心的時刻與你分享。 如果有一天侨嘀,我們要分離臭挽,我會將我們最開心的一刻永遠(yuǎn)的...
    Lucifer83閱讀 956評論 0 50
  • 雪山上 云海下 一片森林 一種奇跡 萬物都有秘密 你的秘密 好像 藏在山里 你卻笑著說 我的秘密 其實藏在 天空里
    博弈人藝閱讀 271評論 0 0
  • 試試,先貼篇舊作咬腕。 四月初八烏飯麻糍香 黃曉慧 今天是農(nóng)歷四月初八欢峰,這一天,溫嶺的不少地方,如大溪纽帖、新河等地都保留...
    江南蘭花閱讀 1,345評論 0 2