{"id":505,"date":"2017-11-17T19:11:33","date_gmt":"2017-11-17T19:11:33","guid":{"rendered":"http:\/\/www.codeastar.com\/?p=505"},"modified":"2018-01-23T21:25:22","modified_gmt":"2018-01-23T21:25:22","slug":"data-science-model-params-tuning","status":"publish","type":"post","link":"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/","title":{"rendered":"To win big in real estate market using data science – Part 2: Model Params Tuning"},"content":{"rendered":"

Previously<\/a> on CodeAStar: A data alchemist wannabe tried to win big in real estate market, he then used Kaggle’s Housing Regression<\/a> data set, engineered the features and fit them in a bunch of models. Dang! Nothing fancy happened. But he then discovered “the room”, the room for improvement — model params tuning.<\/em><\/p>\n

<\/p>\n

Enter the Model Params Tuning Room<\/h3>\n

Before we enter “the room for improvement”, let’s rewind our models’ scores from last post<\/a>:<\/p>\n

[LinearRegression - LrE] Mean: 0.11596371 Std. Dev.: 0.012097\r\n[Ridge - RidCV] Mean: 0.11388354 Std. Dev.: 0.012075\r\n[Lars - LarCV] Mean: 0.11630241 Std. Dev.: 0.011665\r\n[Lasso - LasCV] Mean: 0.19612691 Std. Dev.: 0.008914\r\n[ElasticNet - ElNCV] Mean: 0.19630787 Std. Dev.: 0.008867\r\n[LassoLars - LaLaCV] Mean: 0.11258596 Std. Dev.: 0.012750\r\n[XGBoost - XGB] Mean: 0.11961144 Std. Dev.: 0.016610<\/pre>\n

And the chart goes:<\/p>\n

\"\"<\/p>\n

Since there is nothing else to tune in the Linear Regression model<\/a>, we start our tuning journey on the Ridge model.<\/p>\n

Ridge model is a regression model with L2 regularization, i.e. with the sum of square of coefficients. When we pass a stronger regularization parameter (alpha) to Ridge, it reduces feature variances and the model complexity, but causes underfitting. On the other hand, when we pass a smaller alpha parameter to Ridge, it trends to fit each deviation and causes overfitting. When we pass a 0 as alpha, it just becomes plain Linear Regression. So, how should we tune our Ridge model?<\/p>\n

With great power comes great “regularization”<\/h3>\n

My Uncle Ben told me once…..<\/p>\n

“@#%! Do you read CodeAStar web site? Why don’t you use the K-Fold Cross Validation for model params tuning??”<\/p>\n

Okay, just know that Uncle Ben is a loyal CodeAStar reader. Thank you Ben, let’ start to use our good O’\u00a0K-Fold Cross Validation<\/a>.<\/p>\n

We can reuse our code from previous post on the CV part and add a list of alpha parameter to Ridge:<\/p>\n

kfold = KFold(n_splits=10)\r\n\r\ndef getCVResult(models, X_learning, Y_learning):\r\n  rmsds = []\r\n\r\n  for name, model in models:\r\n     cv_results = cross_val_score(model, X_learning, Y_learning, scoring='neg_mean_squared_error', cv=kfold )\r\n     rmsd_scores = np.sqrt(-cv_results)\r\n     print(\"\\n[%s] Mean: %.8f Std. Dev.: %8f\" %(name, rmsd_scores.mean(), rmsd_scores.std()))\r\n     rmsds.append(rmsd_scores.mean())\r\n  return rmsds \r\n\r\nalphas = [0.00001, 0.00005, 0.0001, 0.0005, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 1.5]\r\nmodels_R = []\r\n\r\nfor alpha in alphas:\r\n   models_R.append((\"Rid_\"+str(alpha), Ridge(alpha=alpha) ))\r\n\r\nrmsds = getCVResult(models_R, X_learning, Y_learning)\r\n<\/pre>\n

And get following results:<\/p>\n

[Rid_1e-05] Mean: 0.11348263 Std. Dev.: 0.012197\r\n[Rid_5e-05] Mean: 0.11336354 Std. Dev.: 0.012281\r\n[Rid_0.0001] Mean: 0.11333158 Std. Dev.: 0.012282\r\n[Rid_0.0005] Mean: 0.11320434 Std. Dev.: 0.012232\r\n[Rid_0.005] Mean: 0.11268473 Std. Dev.: 0.012124\r\n[Rid_0.01] Mean: 0.11255269 Std. Dev.: 0.012144   <---<\/em>\r\n[Rid_0.05] Mean: 0.11313334 Std. Dev.: 0.012147\r\n[Rid_0.1] Mean: 0.11388355 Std. Dev.: 0.012075\r\n[Rid_0.5] Mean: 0.11617453 Std. Dev.: 0.011926\r\n[Rid_1] Mean: 0.11696996 Std. Dev.: 0.011962\r\n[Rid_1.5] Mean: 0.11732840 Std. Dev.: 0.012024\r\n<\/pre>\n

Let’s put our results in a data frame.<\/p>\n

df_ridge = pd.DataFrame(alphas, columns=['alpha'])\r\ndf_ridge['rmsd'] = rmsds\r\nsns.pointplot(x=\"alpha\", y=\"rmsd\", data=df_ridge)\r\nplt.show()\r\n<\/pre>\n

A picture is worth a thousand words (although I rarely post more than 1000 words here):<\/p>\n

\"\"<\/p>\n

Let’s back up, a larger alpha brings out underfitting and a smaller one brings out overfitting. When we apply the K-Fold CV, we can get the most suitable value we want.<\/p>\n

The Lasso of Truth<\/h3>\n

Wonder Woman’s golden lasso can make people confess and tell the truth. There is a “Lasso” model in data science, but it is nothing related to the Wonder Woman’s weapon. Although it is no the Lasso of Truth, it does help us to get better prediction on our subjects.<\/p>\n

Likes Ridge model, Lasso model is a regression model with regularization. But this time, it is L1 regularization, i.e. with the sum of absolute value of coefficients. Theoretically, Lasso should be a better model as it performs feature selection. It ignores features with zero coefficient to prevent overfitting. But, we don’t have million features for Lasso to select. So it is no much difference for using either L1 or L2 regularization,\u00a0at least in current data set.<\/p>\n

We then do the same routine as Ridge model, by applying a set of alpha values, and let CV handle the rest:<\/p>\n

alphas = [0.000001, 0.000005,0.00001, 0.00005, 0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1]\r\nmodels_las = []\r\n\r\nfor alpha in alphas:\r\n   models_las.append((\"Las_\"+str(alpha), Lasso(alpha=alpha) ))\r\n<\/pre>\n

Here come the scores:<\/p>\n

[Las_1e-06] Mean: 0.11310858 Std. Dev.: 0.012213\r\n[Las_5e-06] Mean: 0.11258957 Std. Dev.: 0.011937\r\n[Las_1e-05] Mean: 0.11238117 Std. Dev.: 0.011936  <---<\/em>\r\n[Las_5e-05] Mean: 0.11334478 Std. Dev.: 0.012809\r\n[Las_0.0001] Mean: 0.11526842 Std. Dev.: 0.012386\r\n[Las_0.0005] Mean: 0.11833705 Std. Dev.: 0.012650\r\n[Las_0.001] Mean: 0.11961042 Std. Dev.: 0.012739\r\n[Las_0.005] Mean: 0.12906609 Std. Dev.: 0.012915\r\n[Las_0.01] Mean: 0.13737188 Std. Dev.: 0.011742\r\n[Las_0.05] Mean: 0.17137819 Std. Dev.: 0.008359\r\n[Las_0.1] Mean: 0.19586111 Std. Dev.: 0.009045\r\n<\/pre>\n

Let’s visualize the output again:<\/p>\n

\"\"<\/p>\n

We then apply the same routine on ElasticNet and LassoLars models to find the best parameters:<\/p>\n

#ElasticNet with alpha = 0.00001 and L1 ratio = 0.8\r\n[ELN_L1_0.8] Mean: 0.11219824 Std. Dev.: 0.012191\r\n\r\n#LassoLars  with alpha = 0.000037\r\n[LaLa_3.7e-05] Mean: 0.11207374 Std. Dev.: 0.012852\r\n<\/pre>\n

Cross Validation checks model’s parameter one by one. What if we want to tune more than one parameter a time? No problem, we can use grid search in finding the best parameter combination.<\/p>\n

Grid Search Tuning<\/h3>\n

Let’ start our grid search tuning with XGBoost model. First, we get our\u00a0estimator value from the Cross Validation method, i.e. n_estimators = 470. Then we try to find the best max_depth<\/strong> and min_child_weight<\/strong> values using GridSearchCV()<\/em>.<\/p>\n

from sklearn.model_selection import cross_val_score, GridSearchCV\r\n\r\nparam_test = \r\n{\r\n 'max_depth':[3,4,5,7],\r\n 'min_child_weight':[2,3,4]\r\n}\r\ngsearch = GridSearchCV(estimator = xgb.XGBRegressor(n_estimators=470), \r\n      param_grid = param_test, scoring='neg_mean_squared_error', cv=kfold)\r\ngsearch.fit(X_learning,Y_learning)\r\n\r\nprint(gsearch.best_params_ )\r\nprint(np.sqrt(-gsearch.best_score_ ))\r\n<\/pre>\n

We put tuning parameters into param_test<\/em> array and let GridSearchCV() do the validation job.\u00a0The program will then print out the best parameter combination and the best RMSD score.<\/p>\n

{'max_depth': 3, 'min_child_weight': 3}\r\n0.115714387592\r\n<\/pre>\n

Now we put\u00a0n_estimators<\/em>, max_depth<\/em> and min_child_weight<\/em> into XGBRegressor,\u00a0 and run CV to find the best gamma<\/em> value.<\/p>\n

gammas = [0.0002, 0.0003, 0.00035, 0.0004, 0.0005]\r\nmodels_xgb_gamma = []\r\n\r\nfor gamma in gammas:\r\n   models_xgb_gamma.append((\"XGB_\"+str(gamma), xgb.XGBRegressor(n_estimators=470,max_depth=3, min_child_weight=3, gamma=gamma ) ))\r\n\r\ngetCVResult(models_xgb_gamma, X_learning, Y_learning)\r\n<\/pre>\n

We pick the best result from CV:<\/p>\n

[XGB_0.0003] Mean: 0.11366855 Std. Dev.: 0.012560\r\n<\/pre>\n

After that, we keep running GridSearchCV() <\/em>and CV\u00a0with other parameters:\u00a0subsample, learning_rate, reg_alpha and reg_lambda. Thus, we can find the best parameter combination for XGBRegressor model.<\/p>\n

It’ Show Time<\/h3>\n

We have tuned our models, it is the time to see how it can improve our models’ performances.<\/p>\n

tuned_models = []\r\ntuned_models.append((\"Rid_t\", Ridge(alpha=0.01) ))\r\ntuned_models.append((\"Las_t\", Lasso(alpha=0.00001) ))\r\ntuned_models.append((\"ElN_t\", ElasticNet(l1_ratio=0.8, alpha=0.00001) ))\r\ntuned_models.append((\"LaLa_t\", LassoLars(alpha=0.000037) ))\r\ntuned_models.append((\"XGB_t\", xgb.XGBRegressor(n_estimators=470,max_depth=3, min_child_weight=3, \r\n                                                                learning_rate=0.042,subsample=0.5, \r\n                                                               reg_alpha=0.5,reg_lambda=0.8)  ))\r\n\r\ngetCVResult(tuned_models, X_learning, Y_learning)\r\n<\/pre>\n

Here they come:<\/p>\n

[Ridge Tuned Rid_t] Mean: 0.11255269 Std. Dev.: 0.012144\r\n[Lasso Tuned Las_t] Mean: 0.11238117 Std. Dev.: 0.011936\r\n[ELasticNet Tuned ElN_t] Mean: 0.11233786 Std. Dev.: 0.011963\r\n[LassoLars Tuned LaLa_t] Mean: 0.11231273 Std. Dev.: 0.012701\r\n[XGBoost Tuned XGB_t] Mean: 0.11190687 Std. Dev.: 0.015171\r\n<\/pre>\n

With new chart:<\/p>\n

\"\"<\/p>\n

We find that all the tuned models perform better than before! We are getting closer and closer to the “room” for improvement.<\/p>\n

But, there is something missing in our post. We have used CV and GridSearchCV for getting the best parameters, however other than the alpha parameter, the detail of each parameter is omitted. What is going on here? Well, we will leave this topic to next post, the final chapter<\/a> of our housing regression model\u00a0trilogy :]] .<\/p>\n

What have we learnt in this post?<\/h3>\n
    \n
  1. Apply model params tuning can get better prediction<\/li>\n
  2. Use cross validation for getting the best single parameter in a model<\/li>\n
  3. Use GridSearchCV() method for getting the best combination among parameters<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"

    Previously on CodeAStar: A data alchemist wannabe tried to win big in real estate market, he then used Kaggle’s Housing Regression data set, engineered the features and fit them in a bunch of models. Dang! Nothing fancy happened. But he then discovered “the room”, the room for improvement — model params tuning.<\/p>\n","protected":false},"author":1,"featured_media":544,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[18],"tags":[19,26,37,38,28],"jetpack_publicize_connections":[],"yoast_head":"\nTo win big in real estate market using data science - Part 2: Model Params Tuning ⋆ Code A Star<\/title>\n<meta name=\"description\" content=\"A data scientist wannabe tries to win big in real estate market, he then discovered a key factor of prediction improvement --- Model Params Tuning\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"To win big in real estate market using data science - Part 2: Model Params Tuning ⋆ Code A Star\" \/>\n<meta property=\"og:description\" content=\"A data scientist wannabe tries to win big in real estate market, he then discovered a key factor of prediction improvement --- Model Params Tuning\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/\" \/>\n<meta property=\"og:site_name\" content=\"Code A Star\" \/>\n<meta property=\"article:publisher\" content=\"codeastar\" \/>\n<meta property=\"article:author\" content=\"codeastar\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-17T19:11:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-23T21:25:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.codeastar.com\/wp-content\/uploads\/2017\/11\/tuning_fin.png?fit=688%2C644&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"688\" \/>\n\t<meta property=\"og:image:height\" content=\"644\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Raven Hon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codeastar\" \/>\n<meta name=\"twitter:site\" content=\"@codeastar\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Raven Hon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/\"},\"author\":{\"name\":\"Raven Hon\",\"@id\":\"https:\/\/www.codeastar.com\/#\/schema\/person\/832d202eb92a3d430097e88c6d0550bd\"},\"headline\":\"To win big in real estate market using data science – Part 2: Model Params Tuning\",\"datePublished\":\"2017-11-17T19:11:33+00:00\",\"dateModified\":\"2018-01-23T21:25:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/\"},\"wordCount\":811,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.codeastar.com\/#\/schema\/person\/832d202eb92a3d430097e88c6d0550bd\"},\"keywords\":[\"Data Science\",\"k-fold cross validation\",\"Model Params Tuning\",\"Parameter Tuning\",\"XGBoost\"],\"articleSection\":[\"Learn Machine Learning\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/\",\"url\":\"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/\",\"name\":\"To win big in real estate market using data science - Part 2: Model Params Tuning ⋆ Code A Star\",\"isPartOf\":{\"@id\":\"https:\/\/www.codeastar.com\/#website\"},\"datePublished\":\"2017-11-17T19:11:33+00:00\",\"dateModified\":\"2018-01-23T21:25:22+00:00\",\"description\":\"A data scientist wannabe tries to win big in real estate market, he then discovered a key factor of prediction improvement --- Model Params Tuning\",\"breadcrumb\":{\"@id\":\"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.codeastar.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"To win big in real estate market using data science – Part 2: Model Params Tuning\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.codeastar.com\/#website\",\"url\":\"https:\/\/www.codeastar.com\/\",\"name\":\"Code A Star\",\"description\":\"We don't wish upon a star, we code a star\",\"publisher\":{\"@id\":\"https:\/\/www.codeastar.com\/#\/schema\/person\/832d202eb92a3d430097e88c6d0550bd\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.codeastar.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.codeastar.com\/#\/schema\/person\/832d202eb92a3d430097e88c6d0550bd\",\"name\":\"Raven Hon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codeastar.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.codeastar.com\/wp-content\/uploads\/2018\/08\/logo70.png?fit=70%2C70&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.codeastar.com\/wp-content\/uploads\/2018\/08\/logo70.png?fit=70%2C70&ssl=1\",\"width\":70,\"height\":70,\"caption\":\"Raven Hon\"},\"logo\":{\"@id\":\"https:\/\/www.codeastar.com\/#\/schema\/person\/image\/\"},\"description\":\"Raven Hon is\u00a0a 20 years+ veteran in information technology industry who has worked on various projects from console, web, game, banking and mobile applications in different sized companies.\",\"sameAs\":[\"https:\/\/www.codeastar.com\",\"codeastar\",\"https:\/\/twitter.com\/codeastar\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"To win big in real estate market using data science - Part 2: Model Params Tuning ⋆ Code A Star","description":"A data scientist wannabe tries to win big in real estate market, he then discovered a key factor of prediction improvement --- Model Params Tuning","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/","og_locale":"en_US","og_type":"article","og_title":"To win big in real estate market using data science - Part 2: Model Params Tuning ⋆ Code A Star","og_description":"A data scientist wannabe tries to win big in real estate market, he then discovered a key factor of prediction improvement --- Model Params Tuning","og_url":"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/","og_site_name":"Code A Star","article_publisher":"codeastar","article_author":"codeastar","article_published_time":"2017-11-17T19:11:33+00:00","article_modified_time":"2018-01-23T21:25:22+00:00","og_image":[{"width":688,"height":644,"url":"https:\/\/i0.wp.com\/www.codeastar.com\/wp-content\/uploads\/2017\/11\/tuning_fin.png?fit=688%2C644&ssl=1","type":"image\/png"}],"author":"Raven Hon","twitter_card":"summary_large_image","twitter_creator":"@codeastar","twitter_site":"@codeastar","twitter_misc":{"Written by":"Raven Hon","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/#article","isPartOf":{"@id":"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/"},"author":{"name":"Raven Hon","@id":"https:\/\/www.codeastar.com\/#\/schema\/person\/832d202eb92a3d430097e88c6d0550bd"},"headline":"To win big in real estate market using data science – Part 2: Model Params Tuning","datePublished":"2017-11-17T19:11:33+00:00","dateModified":"2018-01-23T21:25:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/"},"wordCount":811,"commentCount":0,"publisher":{"@id":"https:\/\/www.codeastar.com\/#\/schema\/person\/832d202eb92a3d430097e88c6d0550bd"},"keywords":["Data Science","k-fold cross validation","Model Params Tuning","Parameter Tuning","XGBoost"],"articleSection":["Learn Machine Learning"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codeastar.com\/data-science-model-params-tuning\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/","url":"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/","name":"To win big in real estate market using data science - Part 2: Model Params Tuning ⋆ Code A Star","isPartOf":{"@id":"https:\/\/www.codeastar.com\/#website"},"datePublished":"2017-11-17T19:11:33+00:00","dateModified":"2018-01-23T21:25:22+00:00","description":"A data scientist wannabe tries to win big in real estate market, he then discovered a key factor of prediction improvement --- Model Params Tuning","breadcrumb":{"@id":"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codeastar.com\/data-science-model-params-tuning\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.codeastar.com\/data-science-model-params-tuning\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codeastar.com\/"},{"@type":"ListItem","position":2,"name":"To win big in real estate market using data science – Part 2: Model Params Tuning"}]},{"@type":"WebSite","@id":"https:\/\/www.codeastar.com\/#website","url":"https:\/\/www.codeastar.com\/","name":"Code A Star","description":"We don't wish upon a star, we code a star","publisher":{"@id":"https:\/\/www.codeastar.com\/#\/schema\/person\/832d202eb92a3d430097e88c6d0550bd"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codeastar.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.codeastar.com\/#\/schema\/person\/832d202eb92a3d430097e88c6d0550bd","name":"Raven Hon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codeastar.com\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/www.codeastar.com\/wp-content\/uploads\/2018\/08\/logo70.png?fit=70%2C70&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.codeastar.com\/wp-content\/uploads\/2018\/08\/logo70.png?fit=70%2C70&ssl=1","width":70,"height":70,"caption":"Raven Hon"},"logo":{"@id":"https:\/\/www.codeastar.com\/#\/schema\/person\/image\/"},"description":"Raven Hon is\u00a0a 20 years+ veteran in information technology industry who has worked on various projects from console, web, game, banking and mobile applications in different sized companies.","sameAs":["https:\/\/www.codeastar.com","codeastar","https:\/\/twitter.com\/codeastar"]}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.codeastar.com\/wp-content\/uploads\/2017\/11\/tuning_fin.png?fit=688%2C644&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8PcRO-89","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.codeastar.com\/wp-json\/wp\/v2\/posts\/505"}],"collection":[{"href":"https:\/\/www.codeastar.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codeastar.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codeastar.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codeastar.com\/wp-json\/wp\/v2\/comments?post=505"}],"version-history":[{"count":31,"href":"https:\/\/www.codeastar.com\/wp-json\/wp\/v2\/posts\/505\/revisions"}],"predecessor-version":[{"id":758,"href":"https:\/\/www.codeastar.com\/wp-json\/wp\/v2\/posts\/505\/revisions\/758"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codeastar.com\/wp-json\/wp\/v2\/media\/544"}],"wp:attachment":[{"href":"https:\/\/www.codeastar.com\/wp-json\/wp\/v2\/media?parent=505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codeastar.com\/wp-json\/wp\/v2\/categories?post=505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codeastar.com\/wp-json\/wp\/v2\/tags?post=505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}