11. Maching learing system design

Maching learing system design

Prioritizing what to work on: Spam classification example

Buliding a spam classifier

How to spend your time to make it have low error?

  • Collect lots of data
  • Develop sophisticated features base on email routing information (from email header).
  • Develop sophisticated features for message body.
  • Develop sophisticated algorithm to detect misspellings.

Error analysis

Recommended approach

  • Start with a simple algorithm that you can implement quickly. Implement it and test it on your cross-validation data.
  • Plot learning curves to decide if more data, more features are likely to help.
  • Error analysis: Manually examine the examples (in cross validation set) that your algorithm made errors on. See if you spot any systematic trend in what type of examples it is making errors on.
  • numerical evaluation.Try to find a way to numerical analysis your algorthim performance.

Error metrics for skewed classed (偏斜類)

skewed class: The ratio of positvie to native examplse is very close to one of two extremes.

Precison (P): Of all patients where we predicted y=1 , what fraction actually has cancer?\frac{True\ positives}{predicted\ positives}
Recall (R):Of all patients that actually have cancer, what fraction did we correctly detect as hvaing cancer?\frac{True\ positives}{actual\ positives}

Trading off precision and recall

By change the threshold of the h_\theta(x), we can blance precision and recall.

F1 Score (F Score)

F1 Score: 2\frac{PR}{P+R}
0\le F\le 1

Data for machine learing

How much data to train on?
There is a saying, "It's not who has the best algorithm that wins. It's who that has the most data."

Large data rationale

Assume feature x\in R^{n+1} has sufficient information to predict y accurately.

Assume training set is large enough to use a learing algorithm with many prameters.

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末概疆,一起剝皮案震驚了整個濱河市奉件,隨后出現(xiàn)的幾起案子娇豫,更是在濱河造成了極大的恐慌,老刑警劉巖芝加,帶你破解...
    沈念sama閱讀 222,627評論 6 517
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機围橡,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,180評論 3 399
  • 文/潘曉璐 我一進(jìn)店門暖混,熙熙樓的掌柜王于貴愁眉苦臉地迎上來缕贡,“玉大人,你說我怎么就攤上這事×肋洌” “怎么了收擦?”我有些...
    開封第一講書人閱讀 169,346評論 0 362
  • 文/不壞的土叔 我叫張陵,是天一觀的道長谍倦。 經(jīng)常有香客問我塞赂,道長,這世上最難降的妖魔是什么昼蛀? 我笑而不...
    開封第一講書人閱讀 60,097評論 1 300
  • 正文 為了忘掉前任宴猾,我火速辦了婚禮,結(jié)果婚禮上叼旋,老公的妹妹穿的比我還像新娘仇哆。我一直安慰自己,他們只是感情好夫植,可當(dāng)我...
    茶點故事閱讀 69,100評論 6 398
  • 文/花漫 我一把揭開白布讹剔。 她就那樣靜靜地躺著,像睡著了一般详民。 火紅的嫁衣襯著肌膚如雪延欠。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 52,696評論 1 312
  • 那天沈跨,我揣著相機與錄音由捎,去河邊找鬼。 笑死谒出,一個胖子當(dāng)著我的面吹牛隅俘,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播笤喳,決...
    沈念sama閱讀 41,165評論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼为居,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了杀狡?” 一聲冷哼從身側(cè)響起蒙畴,我...
    開封第一講書人閱讀 40,108評論 0 277
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎呜象,沒想到半個月后膳凝,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,646評論 1 319
  • 正文 獨居荒郊野嶺守林人離奇死亡恭陡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,709評論 3 342
  • 正文 我和宋清朗相戀三年蹬音,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片休玩。...
    茶點故事閱讀 40,861評論 1 353
  • 序言:一個原本活蹦亂跳的男人離奇死亡著淆,死狀恐怖劫狠,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情永部,我是刑警寧澤独泞,帶...
    沈念sama閱讀 36,527評論 5 351
  • 正文 年R本政府宣布,位于F島的核電站苔埋,受9級特大地震影響懦砂,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜组橄,卻給世界環(huán)境...
    茶點故事閱讀 42,196評論 3 336
  • 文/蒙蒙 一荞膘、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧玉工,春花似錦衫画、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,698評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至费奸,卻和暖如春弥激,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背愿阐。 一陣腳步聲響...
    開封第一講書人閱讀 33,804評論 1 274
  • 我被黑心中介騙來泰國打工微服, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人缨历。 一個月前我還...
    沈念sama閱讀 49,287評論 3 379
  • 正文 我出身青樓以蕴,卻偏偏與公主長得像,于是被迫代替她去往敵國和親辛孵。 傳聞我的和親對象是個殘疾皇子丛肮,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 45,860評論 2 361