|
29 | 29 | "source": [ |
30 | 30 | "from __future__ import print_function\n", |
31 | 31 | "\n", |
| 32 | + "\n", |
32 | 33 | "import numpy as np\n", |
33 | 34 | "from scipy.stats import ttest_rel\n", |
34 | 35 | "\n", |
|
40 | 41 | "\n", |
41 | 42 | "from catboost import CatBoostRegressor\n", |
42 | 43 | "\n", |
| 44 | + "import warnings\n", |
| 45 | + "warnings.filterwarnings(\"ignore\", category=ConvergenceWarning)\n", |
| 46 | + "\n", |
43 | 47 | "seed = 42" |
44 | 48 | ] |
45 | 49 | }, |
|
2084 | 2088 | { |
2085 | 2089 | "data": { |
2086 | 2090 | "application/vnd.jupyter.widget-view+json": { |
2087 | | - "model_id": "97d5fcc4c2f94bdca55c64cf4bf86be5", |
| 2091 | + "model_id": "32fcc6bdcba642b988bd0403786ee525", |
2088 | 2092 | "version_major": 2, |
2089 | 2093 | "version_minor": 0 |
2090 | 2094 | }, |
2091 | 2095 | "text/plain": [ |
2092 | | - "MetricVisualizer(layout=Layout(align_self=u'stretch', height=u'500px'))" |
| 2096 | + "MetricVisualizer(layout=Layout(align_self='stretch', height='500px'))" |
2093 | 2097 | ] |
2094 | 2098 | }, |
2095 | 2099 | "metadata": {}, |
|
2116 | 2120 | "cb_regressor = CatBoostRegressor(**catboost_params)\n", |
2117 | 2121 | "cb_regressor.fit(X_train, y_train, eval_set=(X_validate, y_validate), plot=True)\n", |
2118 | 2122 | "print(\"tree count: {}\".format(cb_regressor.tree_count_))\n", |
2119 | | - "print(\"best rmse: {:.5}\".format(cb_regressor.best_score_['validation_0'][\"RMSE\"]))" |
| 2123 | + "print(\"best rmse: {:.5}\".format(cb_regressor.best_score_['validation'][\"RMSE\"]))" |
2120 | 2124 | ] |
2121 | 2125 | }, |
2122 | 2126 | { |
|
2167 | 2171 | "name": "stderr", |
2168 | 2172 | "output_type": "stream", |
2169 | 2173 | "text": [ |
2170 | | - "C:\\Users\\strashila\\AppData\\Local\\Continuum\\anaconda2\\lib\\site-packages\\sklearn\\linear_model\\coordinate_descent.py:492: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Fitting data with very small alpha may cause precision problems.\n", |
| 2174 | + "/Users/vadimborisov/anaconda3/lib/python3.7/site-packages/sklearn/linear_model/coordinate_descent.py:492: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Fitting data with very small alpha may cause precision problems.\n", |
2171 | 2175 | " ConvergenceWarning)\n" |
2172 | 2176 | ] |
2173 | 2177 | }, |
|
2176 | 2180 | "output_type": "stream", |
2177 | 2181 | "text": [ |
2178 | 2182 | "best alpha: 0.00316\n", |
2179 | | - "best rmse: 0.591689214194\n" |
| 2183 | + "best rmse: 0.5916892141942673\n" |
2180 | 2184 | ] |
2181 | 2185 | } |
2182 | 2186 | ], |
|
2269 | 2273 | ], |
2270 | 2274 | "metadata": { |
2271 | 2275 | "kernelspec": { |
2272 | | - "display_name": "Python 2", |
| 2276 | + "display_name": "Python 3", |
2273 | 2277 | "language": "python", |
2274 | | - "name": "python2" |
| 2278 | + "name": "python3" |
2275 | 2279 | }, |
2276 | 2280 | "language_info": { |
2277 | 2281 | "codemirror_mode": { |
2278 | 2282 | "name": "ipython", |
2279 | | - "version": 2 |
| 2283 | + "version": 3 |
2280 | 2284 | }, |
2281 | 2285 | "file_extension": ".py", |
2282 | 2286 | "mimetype": "text/x-python", |
2283 | 2287 | "name": "python", |
2284 | 2288 | "nbconvert_exporter": "python", |
2285 | | - "pygments_lexer": "ipython2", |
2286 | | - "version": "2.7.15" |
| 2289 | + "pygments_lexer": "ipython3", |
| 2290 | + "version": "3.7.1" |
2287 | 2291 | } |
2288 | 2292 | }, |
2289 | 2293 | "nbformat": 4, |
|
0 commit comments