Created
February 11, 2018 11:56
-
-
Save regonn/4ab97e9065bfa55cebf150a7a2474b03 to your computer and use it in GitHub Desktop.
LightGBM jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"ENV[\"LIGHTGBM_PATH\"] = \"/home/regonn/LightGBM\" # 環境変数にLightBGMをインストールしたディレクトリを指定\n", | |
"using LightGBM" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"500-element Array{Float64,1}:\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 0.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 0.0\n", | |
" 0.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" ⋮ \n", | |
" 1.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 0.0" | |
] | |
}, | |
"execution_count": 2, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# LightGBM 側に用意されているサンプルデータを利用する\n", | |
"binary_test = readdlm(ENV[\"LIGHTGBM_PATH\"] * \"/examples/regression/regression.test\", '\\t')\n", | |
"binary_train = readdlm(ENV[\"LIGHTGBM_PATH\"] * \"/examples/regression/regression.train\", '\\t')\n", | |
"X_train = binary_train[:, 2:end]\n", | |
"y_train = binary_train[:, 1]\n", | |
"X_test = binary_test[:, 2:end]\n", | |
"y_test = binary_test[:, 1]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"7000-element Array{Float64,1}:\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 1.0\n", | |
" ⋮ \n", | |
" 1.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 1.0\n", | |
" 0.0\n", | |
" 0.0\n", | |
" 0.0\n", | |
" 1.0" | |
] | |
}, | |
"execution_count": 3, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"y_train" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"7000×28 Array{Float64,2}:\n", | |
" 0.869 -0.635 0.226 0.327 -0.69 … 0.978 0.92 0.722 0.989 0.877\n", | |
" 0.908 0.329 0.359 1.498 -0.313 0.986 0.978 0.78 0.992 0.798\n", | |
" 0.799 1.471 -1.636 0.454 0.426 0.986 0.951 0.803 0.866 0.78 \n", | |
" 1.344 -0.877 0.936 1.992 0.882 0.999 0.728 0.869 1.027 0.958\n", | |
" 1.105 0.321 1.522 0.883 -1.205 0.987 0.838 1.133 0.872 0.808\n", | |
" 1.596 -0.608 0.007 1.818 -0.112 … 0.972 0.789 0.431 0.961 0.958\n", | |
" 0.409 -1.885 -1.027 1.672 -1.605 1.001 0.545 0.699 0.977 0.829\n", | |
" 0.934 0.629 0.528 0.238 -0.967 0.98 0.783 0.849 0.894 0.775\n", | |
" 1.405 0.537 0.69 1.18 -0.11 1.176 1.045 1.543 3.535 2.741\n", | |
" 1.177 0.104 1.397 0.48 0.266 0.986 1.104 0.849 0.937 0.812\n", | |
" 0.946 1.111 1.218 0.908 0.822 … 0.994 0.908 0.776 0.783 0.725\n", | |
" 0.739 -0.178 0.83 0.505 -0.13 0.982 0.542 1.251 0.83 0.761\n", | |
" 1.384 0.117 -1.18 0.763 -0.08 1.192 1.221 0.861 0.929 0.838\n", | |
" ⋮ ⋱ ⋮ \n", | |
" 0.703 0.975 -1.061 1.224 1.205 1.145 1.182 1.024 1.036 0.901\n", | |
" 1.02 -0.172 0.051 0.827 1.679 1.266 0.985 0.908 0.987 0.886\n", | |
" 0.631 0.317 -0.817 0.249 -0.317 … 0.976 1.174 2.141 1.345 1.076\n", | |
" 0.567 1.648 -0.361 0.958 1.051 0.988 0.947 0.916 0.891 0.781\n", | |
" 1.134 -0.303 -0.806 1.27 -1.358 0.984 0.866 0.484 0.709 0.735\n", | |
" 0.758 0.682 -0.444 0.938 -1.632 1.024 0.698 1.089 0.735 0.65 \n", | |
" 1.095 -0.733 0.372 0.939 0.191 1.002 1.687 0.853 1.124 1.103\n", | |
" 0.433 0.852 -1.542 1.366 0.726 … 0.99 0.604 1.151 0.947 1.158\n", | |
" 0.416 -1.352 0.839 0.854 1.269 0.983 0.871 0.915 1.898 1.486\n", | |
" 0.535 1.359 1.126 1.322 -1.572 0.992 0.815 3.348 1.654 1.385\n", | |
" 1.719 0.561 1.517 0.784 -1.006 1.229 0.758 0.469 0.615 0.697\n", | |
" 1.04 -0.803 1.637 0.264 -0.814 0.979 0.914 1.534 1.142 1.018" | |
] | |
}, | |
"execution_count": 4, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"X_train" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"LightGBM.LGBMBinary(LightGBM.Booster(Ptr{Void} @0x0000000000000000, LightGBM.Dataset[]), String[], \"binary\", 100, 0.1, 1000, -1, \"serial\", 4, -1.0, 100, 10.0, 0.0, 0.0, 0.0, 0.8, 2, 0.9, 1, 3, 5, 255, 1, \"\", true, false, Int64[], 1.0, false, String[\"auc\", \"binary_logloss\"], 1, false, Int64[], 1, 12400, 120, \"\", 1)" | |
] | |
}, | |
"execution_count": 5, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# estimatorを作る\n", | |
"estimator = LGBMBinary(num_iterations = 100,\n", | |
" learning_rate = .1,\n", | |
" early_stopping_round = 5,\n", | |
" feature_fraction = .8,\n", | |
" bagging_fraction = .9,\n", | |
" bagging_freq = 1,\n", | |
" num_leaves = 1000,\n", | |
" metric = [\"auc\", \"binary_logloss\"])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[LightGBM] [Info] Number of positive: 3716, number of negative: 3284\n", | |
"[LightGBM] [Info] Total Bins 6143\n", | |
"[LightGBM] [Info] Number of data: 7000, number of used features: 28\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 1, test_1's binary_logloss: 0.671191534194129, auc: 0.771921762125903\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 2, test_1's binary_logloss: 0.6563302881582211, auc: 0.7703898993808049\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 3, test_1's binary_logloss: 0.64126603518517, auc: 0.8003337848297214\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 4, test_1's binary_logloss: 0.6289863515675486, auc: 0.8063322368421053\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 5, test_1's binary_logloss: 0.6160580823615279, auc: 0.8169182146542827\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 6, test_1's binary_logloss: 0.6071160723877269, auc: 0.8165231553147575\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 7, test_1's binary_logloss: 0.5996917891593723, auc: 0.8179582688338494\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 8, test_1's binary_logloss: 0.5940261608844767, auc: 0.8133546181630547\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 9, test_1's binary_logloss: 0.5874490806138669, auc: 0.8100812693498453\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 10, test_1's binary_logloss: 0.5794892591825045, auc: 0.8121130030959752\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 11, test_1's binary_logloss: 0.5745866164706294, auc: 0.8108068885448917\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 12, test_1's binary_logloss: 0.5702212164601028, auc: 0.8109520123839009\n", | |
"Early stopping at iteration 12, the best iteration round is 7\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"Dict{String,Dict{String,Array{Float64,1}}} with 1 entry:\n", | |
" \"test_1\" => Dict(\"binary_logloss\"=>[0.671192, 0.65633, 0.641266, 0.628986, 0.…" | |
] | |
}, | |
"execution_count": 6, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"fit(estimator, X_train, y_train, (X_test, y_test)) # X_test, y_test が無くても動く" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"7000-element Array{Float64,1}:\n", | |
" 0.657192\n", | |
" 0.715537\n", | |
" 0.812562\n", | |
" 0.478307\n", | |
" 0.486012\n", | |
" 0.28559 \n", | |
" 0.730161\n", | |
" 0.775819\n", | |
" 0.519062\n", | |
" 0.775097\n", | |
" 0.706598\n", | |
" 0.495351\n", | |
" 0.775093\n", | |
" ⋮ \n", | |
" 0.593487\n", | |
" 0.757965\n", | |
" 0.233868\n", | |
" 0.796049\n", | |
" 0.397838\n", | |
" 0.541153\n", | |
" 0.606321\n", | |
" 0.391301\n", | |
" 0.485694\n", | |
" 0.207947\n", | |
" 0.417188\n", | |
" 0.461567" | |
] | |
}, | |
"execution_count": 7, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"predict(estimator, X_train) #予測" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"\n", | |
"Cross-validation: 1\n", | |
"[LightGBM] [Info] Number of positive: 1860, number of negative: 1640\n", | |
"[LightGBM] [Info] Total Bins 6143\n", | |
"[LightGBM] [Info] Number of data: 3500, number of used features: 28\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 1, validation's binary_logloss: 0.6761962398302138, auc: 0.7207845666582767\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 2, validation's binary_logloss: 0.6645891145235779, auc: 0.7325465774184076\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 3, validation's binary_logloss: 0.6557263950478679, auc: 0.7370901042977599\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 4, validation's binary_logloss: 0.6480738269884901, auc: 0.7385201673798137\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 5, validation's binary_logloss: 0.6386214713162547, auc: 0.7449707727682692\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 6, validation's binary_logloss: 0.6310083630519153, auc: 0.7516396483555667\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 7, validation's binary_logloss: 0.6259886823934513, auc: 0.750169601843695\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 8, validation's binary_logloss: 0.6209307564947174, auc: 0.7511008552521184\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 9, validation's binary_logloss: 0.6145846110425348, auc: 0.7531264092520346\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 10, validation's binary_logloss: 0.6094231202948845, auc: 0.7548853524309925\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 11, validation's binary_logloss: 0.6056961669786125, auc: 0.7562284023932377\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 12, validation's binary_logloss: 0.6012413599872306, auc: 0.7575095108125681\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 13, validation's binary_logloss: 0.5978807750052266, auc: 0.7586618201505999\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 14, validation's binary_logloss: 0.5946476688792073, auc: 0.7602208461804681\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 15, validation's binary_logloss: 0.5914358811621836, auc: 0.7622075638161758\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 16, validation's binary_logloss: 0.5895258663570311, auc: 0.7620364871738401\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 17, validation's binary_logloss: 0.5879079643291966, auc: 0.762747340118718\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 18, validation's binary_logloss: 0.5861850234906018, auc: 0.764263760854518\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 19, validation's binary_logloss: 0.5844575614822071, auc: 0.7656007477556842\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 20, validation's binary_logloss: 0.5825045056070196, auc: 0.7668166373017871\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 21, validation's binary_logloss: 0.5804828878770318, auc: 0.7685677148879939\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 22, validation's binary_logloss: 0.5794007493866222, auc: 0.7689688601182986\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 23, validation's binary_logloss: 0.5776680524513516, auc: 0.7701847496644014\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 24, validation's binary_logloss: 0.5763123768579416, auc: 0.7708625015731185\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 25, validation's binary_logloss: 0.5756786475541482, auc: 0.7708906866138099\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 26, validation's binary_logloss: 0.5747794120757588, auc: 0.7712367726948569\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 27, validation's binary_logloss: 0.573699488943964, auc: 0.7721560638476382\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 28, validation's binary_logloss: 0.5727750234877628, auc: 0.7721734336982968\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 29, validation's binary_logloss: 0.571435519714165, auc: 0.7733493398145818\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 30, validation's binary_logloss: 0.5709480947913956, auc: 0.7736659299228124\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 31, validation's binary_logloss: 0.57002086044483, auc: 0.7742866562840842\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 32, validation's binary_logloss: 0.5695432375454513, auc: 0.7740041504111083\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 33, validation's binary_logloss: 0.5692095437143933, auc: 0.774248639252454\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 34, validation's binary_logloss: 0.5679047735127715, auc: 0.7753072169435355\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 35, validation's binary_logloss: 0.5679351048757523, auc: 0.7750977955365383\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 36, validation's binary_logloss: 0.568212001077811, auc: 0.7744613379897642\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 37, validation's binary_logloss: 0.5681445716843853, auc: 0.7742555216461112\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 38, validation's binary_logloss: 0.5678141883883677, auc: 0.7745458931118382\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 39, validation's binary_logloss: 0.5676382686913499, auc: 0.77420963902173\n", | |
"Early stopping at iteration 39, the best iteration round is 34\n", | |
"\n", | |
"Cross-validation: 2\n", | |
"[LightGBM] [Info] Number of positive: 1856, number of negative: 1644\n", | |
"[LightGBM] [Info] Total Bins 6143\n", | |
"[LightGBM] [Info] Number of data: 3500, number of used features: 28\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 1, validation's binary_logloss: 0.6755847251188146, auc: 0.7227829137162339\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 2, validation's binary_logloss: 0.6641996359864663, auc: 0.7265499606608969\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 3, validation's binary_logloss: 0.6548018309754131, auc: 0.7431068056648309\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 4, validation's binary_logloss: 0.6465975225104759, auc: 0.7437255769735117\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 5, validation's binary_logloss: 0.6361562768707318, auc: 0.7541778127458694\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 6, validation's binary_logloss: 0.628338653629007, auc: 0.7575606477838972\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 7, validation's binary_logloss: 0.6227185778529146, auc: 0.7596007081038553\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 8, validation's binary_logloss: 0.6174819434359108, auc: 0.7596464398111723\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 9, validation's binary_logloss: 0.6119266650221115, auc: 0.7622931418830318\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 10, validation's binary_logloss: 0.6065072276373505, auc: 0.7626268686073957\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 11, validation's binary_logloss: 0.6028841856902647, auc: 0.7625957251507999\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 12, validation's binary_logloss: 0.6002105013991669, auc: 0.7623370705481248\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 13, validation's binary_logloss: 0.5971796809841962, auc: 0.7621805337004983\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 14, validation's binary_logloss: 0.5948680463621769, auc: 0.7620972659323367\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 15, validation's binary_logloss: 0.5918731878085713, auc: 0.7636985313401521\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 16, validation's binary_logloss: 0.5893261448239243, auc: 0.7646828284815106\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 17, validation's binary_logloss: 0.587321785122666, auc: 0.7647457710464202\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 18, validation's binary_logloss: 0.5864660638363304, auc: 0.764369918699187\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 19, validation's binary_logloss: 0.5842375223724908, auc: 0.7660710070810386\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 20, validation's binary_logloss: 0.5820245738330949, auc: 0.7667007605559927\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 21, validation's binary_logloss: 0.5800738166882032, auc: 0.7682949777078416\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 22, validation's binary_logloss: 0.5790049914214308, auc: 0.7687359034880671\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 23, validation's binary_logloss: 0.5779745941672327, auc: 0.7688691646997116\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n" | |
] | |
}, | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Iteration: 24, validation's binary_logloss: 0.5766289383226102, auc: 0.7695575990034094\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 25, validation's binary_logloss: 0.5753927340607308, auc: 0.7705174731182796\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 26, validation's binary_logloss: 0.5746943229541741, auc: 0.7706528651980068\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 27, validation's binary_logloss: 0.5731705931549794, auc: 0.7718040257015474\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 28, validation's binary_logloss: 0.5733090820663197, auc: 0.7709231576186729\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 29, validation's binary_logloss: 0.5730494734959786, auc: 0.7707300681877787\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 30, validation's binary_logloss: 0.5722429607537552, auc: 0.771144440073433\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 31, validation's binary_logloss: 0.5720525839766215, auc: 0.7708700498295306\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"Iteration: 32, validation's binary_logloss: 0.5715146212825547, auc: 0.7712303304484658\n", | |
"Early stopping at iteration 32, the best iteration round is 27\n", | |
"\n", | |
"Cross-validation finished\n", | |
"- validation's binary_logloss mean: 0.5705376833338754, std: 0.0037234967775105665\n", | |
"- validation's auc mean: 0.7735556213225414, std: 0.0024771302830031575\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"Dict{String,Dict{String,Array{Float64,1}}} with 1 entry:\n", | |
" \"validation\" => Dict(\"binary_logloss\"=>[0.567905, 0.573171],\"auc\"=>[0.775307,…" | |
] | |
}, | |
"execution_count": 8, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"splits = (collect(1:3500), collect(3501:7000))\n", | |
"cv(estimator, X_train, y_train, splits) # cvは勝手に途中で良い所で止めてくれるっぽい" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"\n", | |
"Search: 1\n", | |
"Dict(:learning_rate=>0.1,:bagging_fraction=>0.8)\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"- validation's binary_logloss mean: 0.5727319037704529, std: 0.008455916054388404\n", | |
"- validation's auc mean: 0.7739426810409848, std: 0.0029545094041345844\n", | |
"\n", | |
"Search: 2\n", | |
"Dict(:learning_rate=>0.2,:bagging_fraction=>0.8)\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"- validation's binary_logloss mean: 0.5729551153233241, std: 0.0006417917140560708\n", | |
"- validation's auc mean: 0.7674892839446967, std: 0.0004350161275163196\n", | |
"\n", | |
"Search: 3\n", | |
"Dict(:learning_rate=>0.1,:bagging_fraction=>0.9)\n" | |
] | |
}, | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"- validation's binary_logloss mean: 0.5705376833338756, std: 0.003723496777510488\n", | |
"- validation's auc mean: 0.7735556213225414, std: 0.0024771302830031575\n", | |
"\n", | |
"Search: 4\n", | |
"Dict(:learning_rate=>0.2,:bagging_fraction=>0.9)\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n", | |
"- validation's binary_logloss mean: 0.5735645749623994, std: 0.0008755491344927434\n", | |
"- validation's auc mean: 0.7681266437191041, std: 0.0005083611890898658\n", | |
"\n", | |
"Search finished\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"4-element Array{Tuple{Dict{Symbol,Any},Dict{String,Dict{String,Array{Float64,1}}}},1}:\n", | |
" (Dict{Symbol,Any}(Pair{Symbol,Any}(:learning_rate, 0.1),Pair{Symbol,Any}(:bagging_fraction, 0.8)), Dict(\"validation\"=>Dict(\"binary_logloss\"=>[0.566753, 0.578711],\"auc\"=>[0.776032, 0.771854])))\n", | |
" (Dict{Symbol,Any}(Pair{Symbol,Any}(:learning_rate, 0.2),Pair{Symbol,Any}(:bagging_fraction, 0.8)), Dict(\"validation\"=>Dict(\"binary_logloss\"=>[0.573409, 0.572501],\"auc\"=>[0.767797, 0.767182])))\n", | |
" (Dict{Symbol,Any}(Pair{Symbol,Any}(:learning_rate, 0.1),Pair{Symbol,Any}(:bagging_fraction, 0.9)), Dict(\"validation\"=>Dict(\"binary_logloss\"=>[0.567905, 0.573171],\"auc\"=>[0.775307, 0.771804])))\n", | |
" (Dict{Symbol,Any}(Pair{Symbol,Any}(:learning_rate, 0.2),Pair{Symbol,Any}(:bagging_fraction, 0.9)), Dict(\"validation\"=>Dict(\"binary_logloss\"=>[0.572945, 0.574184],\"auc\"=>[0.768486, 0.767767])))" | |
] | |
}, | |
"execution_count": 9, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"params = [Dict(:learning_rate => learning_rate,\n", | |
" :bagging_fraction => bagging_fraction) for\n", | |
" learning_rate in (.1, .2),\n", | |
" bagging_fraction in (.8, .9)]\n", | |
"search_cv(estimator, X_train, y_train, splits, params) # ハイパーパラメータも組み合わせでcvできる" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Julia 0.6.2", | |
"language": "julia", | |
"name": "julia-0.6" | |
}, | |
"language_info": { | |
"file_extension": ".jl", | |
"mimetype": "application/julia", | |
"name": "julia", | |
"version": "0.6.2" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment