Skip to content

Commit

Permalink
introducing chapter 11 and some other modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
theAfricanQuant committed Apr 19, 2023
1 parent 3a82ecf commit 30cfd6d
Show file tree
Hide file tree
Showing 9 changed files with 820 additions and 18 deletions.
25 changes: 25 additions & 0 deletions .ipynb_checkpoints/README-checkpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Effective XGBoost by Matt Harrison - My Personal Take

This repository contains my personal notes, examples, and code implementations based on the book "Effective XGBoost" by Matt Harrison. The purpose of this repo is to document my journey as I peer thru the mind of a master displaying his craft so I could glean some insights myself into building models that I could use for my projects.

## Table of Contents

2 Datasets

3 Exploratory Data Analysis

4 Tree Creation

5 Stumps on Real Data

6 Model Complexity & Hyperparameters

7 Tree Hyperparameters

8 Random Forest

9 XGBoost

10 Early Stopping

11 XGBoost Hyperparameters
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,20 @@ This repository contains my personal notes, examples, and code implementations b

2 Datasets


3 Exploratory Data Analysis


4 Tree Creation


5 Stumps on Real Data


6 Model Complexity & Hyperparameters


7 Tree Hyperparameters


8 Random Forest

9 XGBoost

10 Early Stopping

11 XGBoost Hyperparameters
24 changes: 12 additions & 12 deletions chp10_EarlyStopping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"[28]\tvalidation_0-logloss:0.38837\tvalidation_1-logloss:0.51135\n",
"[29]\tvalidation_0-logloss:0.38569\tvalidation_1-logloss:0.51202\n",
"[30]\tvalidation_0-logloss:0.37945\tvalidation_1-logloss:0.51352\n",
"[31]\tvalidation_0-logloss:0.37840\tvalidation_1-logloss:0.51545\n"
"[31]\tvalidation_0-logloss:0.37840\tvalidation_1-logloss:0.51545\n",
"[32]\tvalidation_0-logloss:0.37538\tvalidation_1-logloss:0.51581\n"
]
},
{
Expand Down Expand Up @@ -331,7 +332,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 6,
"id": "88e90c50-2933-4822-9d5e-b18e9bfce7d7",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -404,7 +405,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 7,
"id": "f22011c4-74af-4447-be73-0a1e2fe70a09",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -433,7 +434,7 @@
"0.7558011049723757"
]
},
"execution_count": 14,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -458,7 +459,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 8,
"id": "f4058e18-de3e-412c-8391-568c771bf77a",
"metadata": {},
"outputs": [
Expand All @@ -468,7 +469,7 @@
"0.7458563535911602"
]
},
"execution_count": 15,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -500,7 +501,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 9,
"id": "0d0042a9-f9ee-4982-899a-3e12e9cd4ad7",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -545,8 +546,7 @@
"[34]\tvalidation_0-error:0.15261\tvalidation_1-error:0.25525\n",
"[35]\tvalidation_0-error:0.15213\tvalidation_1-error:0.25525\n",
"[36]\tvalidation_0-error:0.15166\tvalidation_1-error:0.25525\n",
"[37]\tvalidation_0-error:0.14550\tvalidation_1-error:0.25525\n",
"[38]\tvalidation_0-error:0.14597\tvalidation_1-error:0.25083\n"
"[37]\tvalidation_0-error:0.14550\tvalidation_1-error:0.25525\n"
]
},
{
Expand All @@ -555,7 +555,7 @@
"0.7624309392265194"
]
},
"execution_count": 16,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -569,7 +569,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 10,
"id": "e3887492-68a4-4711-8f0c-b2b9fc0dc5d0",
"metadata": {},
"outputs": [
Expand All @@ -579,7 +579,7 @@
"19"
]
},
"execution_count": 17,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
720 changes: 720 additions & 0 deletions chp11_XGBoostHyperparameters.ipynb

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions img/xg_depth2_tree0.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
digraph {
graph [ rankdir=TB ];
node [fontname = "Roboto Condensed"];
edge [fontname = "Roboto Thin"];
label = "Learning Rate set to 1"
fontname = "Roboto Condensed"


0 [ label="r<0.5" ]
0 -> 1 [label="yes, missing" color="#0000FF"]
0 -> 2 [label="no" color="#FF0000"]

1 [ label="major_cs<0.5" ]
1 -> 3 [label="yes, missing" color="#0000FF"]
1 -> 4 [label="no" color="#FF0000"]

3 [ label="leaf=-0.282548487" ]

4 [ label="leaf=0.727272749" ]

2 [ label="major_cs<0.5" ]
2 -> 5 [label="yes, missing" color="#0000FF"]
2 -> 6 [label="no" color="#FF0000"]

5 [ label="leaf=-1.50783002" ]

6 [ label="leaf=-0.395721912" ]
}
Binary file added img/xg_depth2_tree0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions img/xg_depth2_tree0_lr001.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
digraph {
graph [ rankdir=TB ];
node [fontname = "Roboto Condensed"];
edge [fontname = "Roboto Thin"];
label = "Learning Rate set to .001"
fontname = "Roboto Condensed"


0 [ label="r<0.5" ]
0 -> 1 [label="yes, missing" color="#0000FF"]
0 -> 2 [label="no" color="#FF0000"]

1 [ label="major_cs<0.5" ]
1 -> 3 [label="yes, missing" color="#0000FF"]
1 -> 4 [label="no" color="#FF0000"]

3 [ label="leaf=-0.000282548513" ]

4 [ label="leaf=0.000727272767" ]

2 [ label="major_cs<0.5" ]
2 -> 5 [label="yes, missing" color="#0000FF"]
2 -> 6 [label="no" color="#FF0000"]

5 [ label="leaf=-0.00150783011" ]

6 [ label="leaf=-0.000395721931" ]
}
Binary file added img/xg_depth2_tree0_lr001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 30cfd6d

Please sign in to comment.