99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
首頁精彩閱讀機(jī)器學(xué)習(xí)中的數(shù)據(jù)集合
機(jī)器學(xué)習(xí)中的數(shù)據(jù)集合
2018-03-31
收藏

機(jī)器學(xué)習(xí)中的數(shù)據(jù)集合

數(shù)據(jù)集分類
有監(jiān)督(supervise)的機(jī)器學(xué)習(xí)中,數(shù)據(jù)集常被分成2~3個(gè),即:訓(xùn)練集(train set) 驗(yàn)證集(validation set) 測試集(test set)。
訓(xùn)練集用來估計(jì)模型,驗(yàn)證集用來確定網(wǎng)絡(luò)結(jié)構(gòu)或者控制模型復(fù)雜程度的參數(shù),而測試集則檢驗(yàn)最終選擇最優(yōu)的模型的性能如何。
Ripley, B.D(1996)在他的經(jīng)典專著Pattern Recognition and Neural Networks中給出了這三個(gè)詞的定義。
Training set:
 A set of examples used for learning, which is to fit the parameters [i.e., weights] of the classifier.
Validation set:
A set of examples used to tune the parameters [i.e., architecture, not weights] of a classifier, for example to choose the number of hidden units in a neural network.
Test set:
 A set of examples used only to assess the performance [generalization] of a fully specified classifier.
顯然,training set是用來訓(xùn)練模型或確定模型參數(shù)的,如ANN中權(quán)值等; validation set是用來做模型選擇(model selection),即做模型的最終優(yōu)化及確定的,如ANN的結(jié)構(gòu);而 test set則純粹是為了測試已經(jīng)訓(xùn)練好的模型的推廣能力。當(dāng)然,test set這并不能保證模型的正確性,他只是說相似的數(shù)據(jù)用此模型會得出相似的結(jié)果。但實(shí)際應(yīng)用中,一般只將數(shù)據(jù)集分成兩類,即training set 和test set,大多數(shù)文章并不涉及validation set。
選擇訓(xùn)練集和測試集
其中一個(gè)典型的劃分是訓(xùn)練集占總樣本的50%,而其它各占25%,三部分都是從樣本中隨機(jī)抽取。樣本少的時(shí)候,上面的劃分就不合適了。常用的是留少部分做測試集。然后對其余N個(gè)樣本采用K折交叉驗(yàn)證法。就是將樣本打亂,然后均勻分成K份,輪流選擇其中K-1份訓(xùn)練,剩余的一份做驗(yàn)證,計(jì)算預(yù)測誤差平方和,最后把K次的預(yù)測誤差平方和再做平均作為選擇最優(yōu)模型結(jié)構(gòu)的依據(jù)。特別的K取N,就是留一法(leave one out)。
數(shù)據(jù)歸一化問題
數(shù)據(jù)歸一化屬于數(shù)據(jù)的預(yù)處理。因?yàn)閟igmoid函數(shù)根據(jù)不同的變換,輸出在0到1或者-1到1之間,因此如果不做歸一,就會出現(xiàn)樣本輸出超出神經(jīng)網(wǎng)絡(luò)輸出的范圍。選擇最大的值max和最小值min,做如下變換
x=(x-min)/(max-min)
就是歸一化。
需要注意的是max和min不應(yīng)該直接選擇為x中的最大值和最小值。原因是樣本只是有限的觀測,有可能還有更大或者更小的觀測,因此合適的選擇應(yīng)該max選取xmax大一些和min比xmin小一些的。歸一化并不總是合適的預(yù)處理,因?yàn)樗荒苁狗植疾粚ΨQ的樣本變得更對稱一些,標(biāo)準(zhǔn)化要好一些。另外,有時(shí)候主成分分析也能起到降維的作用。


數(shù)據(jù)分析咨詢請掃描二維碼

若不方便掃碼,搜微信號:CDAshujufenxi

數(shù)據(jù)分析師資訊
更多

OK
客服在線
立即咨詢
客服在線
立即咨詢
') } function initGt() { var handler = function (captchaObj) { captchaObj.appendTo('#captcha'); captchaObj.onReady(function () { $("#wait").hide(); }).onSuccess(function(){ $('.getcheckcode').removeClass('dis'); $('.getcheckcode').trigger('click'); }); window.captchaObj = captchaObj; }; $('#captcha').show(); $.ajax({ url: "/login/gtstart?t=" + (new Date()).getTime(), // 加隨機(jī)數(shù)防止緩存 type: "get", dataType: "json", success: function (data) { $('#text').hide(); $('#wait').show(); // 調(diào)用 initGeetest 進(jìn)行初始化 // 參數(shù)1:配置參數(shù) // 參數(shù)2:回調(diào),回調(diào)的第一個(gè)參數(shù)驗(yàn)證碼對象,之后可以使用它調(diào)用相應(yīng)的接口 initGeetest({ // 以下 4 個(gè)配置參數(shù)為必須,不能缺少 gt: data.gt, challenge: data.challenge, offline: !data.success, // 表示用戶后臺檢測極驗(yàn)服務(wù)器是否宕機(jī) new_captcha: data.new_captcha, // 用于宕機(jī)時(shí)表示是新驗(yàn)證碼的宕機(jī) product: "float", // 產(chǎn)品形式,包括:float,popup width: "280px", https: true // 更多配置參數(shù)說明請參見:http://docs.geetest.com/install/client/web-front/ }, handler); } }); } function codeCutdown() { if(_wait == 0){ //倒計(jì)時(shí)完成 $(".getcheckcode").removeClass('dis').html("重新獲取"); }else{ $(".getcheckcode").addClass('dis').html("重新獲取("+_wait+"s)"); _wait--; setTimeout(function () { codeCutdown(); },1000); } } function inputValidate(ele,telInput) { var oInput = ele; var inputVal = oInput.val(); var oType = ele.attr('data-type'); var oEtag = $('#etag').val(); var oErr = oInput.closest('.form_box').next('.err_txt'); var empTxt = '請輸入'+oInput.attr('placeholder')+'!'; var errTxt = '請輸入正確的'+oInput.attr('placeholder')+'!'; var pattern; if(inputVal==""){ if(!telInput){ errFun(oErr,empTxt); } return false; }else { switch (oType){ case 'login_mobile': pattern = /^1[3456789]\d{9}$/; if(inputVal.length==11) { $.ajax({ url: '/login/checkmobile', type: "post", dataType: "json", data: { mobile: inputVal, etag: oEtag, page_ur: window.location.href, page_referer: document.referrer }, success: function (data) { } }); } break; case 'login_yzm': pattern = /^\d{6}$/; break; } if(oType=='login_mobile'){ } if(!!validateFun(pattern,inputVal)){ errFun(oErr,'') if(telInput){ $('.getcheckcode').removeClass('dis'); } }else { if(!telInput) { errFun(oErr, errTxt); }else { $('.getcheckcode').addClass('dis'); } return false; } } return true; } function errFun(obj,msg) { obj.html(msg); if(msg==''){ $('.login_submit').removeClass('dis'); }else { $('.login_submit').addClass('dis'); } } function validateFun(pat,val) { return pat.test(val); }