Skip to content

Commit

Permalink
Folder name
Browse files Browse the repository at this point in the history
  • Loading branch information
sonam-packt committed Oct 13, 2020
1 parent 1c48f46 commit 7d9383c
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 76 deletions.
82 changes: 48 additions & 34 deletions Chapter_2_Decision_Trees_In_Depth/Decision_Trees_In_Depth.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -196,7 +196,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -217,7 +217,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -247,7 +247,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -284,7 +284,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand All @@ -293,7 +293,7 @@
"(548, 12)"
]
},
"execution_count": 13,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -304,7 +304,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand All @@ -323,7 +323,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand All @@ -342,7 +342,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 15,
"metadata": {
"scrolled": true
},
Expand Down Expand Up @@ -370,7 +370,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -516,7 +516,7 @@
"4 0 2 1 "
]
},
"execution_count": 17,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -531,7 +531,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -545,7 +545,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 18,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -573,7 +573,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -613,7 +613,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 20,
"metadata": {},
"outputs": [
{
Expand All @@ -627,13 +627,15 @@
{
"data": {
"text/plain": [
"DecisionTreeClassifier(criterion='entropy', max_depth=8, max_features=0.8,\n",
" max_leaf_nodes=45, min_samples_leaf=0.04,\n",
" min_samples_split=10, min_weight_fraction_leaf=0.05,\n",
" random_state=2)"
"DecisionTreeClassifier(ccp_alpha=0.0, class_weight=None, criterion='entropy',\n",
" max_depth=8, max_features=0.8, max_leaf_nodes=45,\n",
" min_impurity_decrease=0.0, min_impurity_split=None,\n",
" min_samples_leaf=0.04, min_samples_split=10,\n",
" min_weight_fraction_leaf=0.05, presort='deprecated',\n",
" random_state=2, splitter='best')"
]
},
"execution_count": 21,
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -654,7 +656,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 21,
"metadata": {},
"outputs": [
{
Expand All @@ -668,12 +670,15 @@
{
"data": {
"text/plain": [
"DecisionTreeClassifier(max_depth=7, max_features=0.78, max_leaf_nodes=45,\n",
"DecisionTreeClassifier(ccp_alpha=0.0, class_weight=None, criterion='gini',\n",
" max_depth=7, max_features=0.78, max_leaf_nodes=45,\n",
" min_impurity_decrease=0.0, min_impurity_split=None,\n",
" min_samples_leaf=0.045, min_samples_split=9,\n",
" min_weight_fraction_leaf=0.06, random_state=2)"
" min_weight_fraction_leaf=0.06, presort='deprecated',\n",
" random_state=2, splitter='best')"
]
},
"execution_count": 22,
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -691,7 +696,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 22,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -724,19 +729,21 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"DecisionTreeClassifier(max_depth=7, max_features=0.78, max_leaf_nodes=45,\n",
"DecisionTreeClassifier(ccp_alpha=0.0, class_weight=None, criterion='gini',\n",
" max_depth=7, max_features=0.78, max_leaf_nodes=45,\n",
" min_impurity_decrease=0.0, min_impurity_split=None,\n",
" min_samples_leaf=0.045, min_samples_split=9,\n",
" min_weight_fraction_leaf=0.06, presort=False,\n",
" random_state=2)"
" random_state=2, splitter='best')"
]
},
"execution_count": 24,
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -753,7 +760,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 24,
"metadata": {},
"outputs": [
{
Expand All @@ -764,7 +771,7 @@
" 0. , 0.18069065, 0.20494446])"
]
},
"execution_count": 25,
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -775,7 +782,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 25,
"metadata": {},
"outputs": [
{
Expand All @@ -786,7 +793,7 @@
" ('ca', 0.18069065321397942)]"
]
},
"execution_count": 26,
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -801,6 +808,13 @@
"# Sort dict by values (as list of tuples)\n",
"sorted(feature_dict.items(), key=operator.itemgetter(1), reverse=True)[0:3]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -819,7 +833,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.8.3"
}
},
"nbformat": 4,
Expand Down
14 changes: 10 additions & 4 deletions Chapter_3_Random_Forest_Bagging/Random_Forest_Baggging.ipynb

Large diffs are not rendered by default.

Binary file modified Chapter_3_Random_Forest_Bagging/Random_Forest_Warm_Start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 30 additions & 8 deletions Chapter_4_Gradient_Boosting/Gradient_Boosting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@
{
"data": {
"text/plain": [
"DecisionTreeRegressor(max_depth=2, random_state=2)"
"DecisionTreeRegressor(ccp_alpha=0.0, criterion='mse', max_depth=2,\n",
" max_features=None, max_leaf_nodes=None,\n",
" min_impurity_decrease=0.0, min_impurity_split=None,\n",
" min_samples_leaf=1, min_samples_split=2,\n",
" min_weight_fraction_leaf=0.0, presort='deprecated',\n",
" random_state=2, splitter='best')"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -229,7 +234,12 @@
{
"data": {
"text/plain": [
"DecisionTreeRegressor(max_depth=2, random_state=2)"
"DecisionTreeRegressor(ccp_alpha=0.0, criterion='mse', max_depth=2,\n",
" max_features=None, max_leaf_nodes=None,\n",
" min_impurity_decrease=0.0, min_impurity_split=None,\n",
" min_samples_leaf=1, min_samples_split=2,\n",
" min_weight_fraction_leaf=0.0, presort='deprecated',\n",
" random_state=2, splitter='best')"
]
},
"execution_count": 6,
Expand All @@ -256,7 +266,12 @@
{
"data": {
"text/plain": [
"DecisionTreeRegressor(max_depth=2, random_state=2)"
"DecisionTreeRegressor(ccp_alpha=0.0, criterion='mse', max_depth=2,\n",
" max_features=None, max_leaf_nodes=None,\n",
" min_impurity_decrease=0.0, min_impurity_split=None,\n",
" min_samples_leaf=1, min_samples_split=2,\n",
" min_weight_fraction_leaf=0.0, presort='deprecated',\n",
" random_state=2, splitter='best')"
]
},
"execution_count": 7,
Expand Down Expand Up @@ -456,7 +471,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Max Depth: None , Score: 869.2783041945797\n",
"Max Depth: None , Score: 867.9366621617327\n",
"Max Depth: 1 , Score: 707.8261886858736\n",
"Max Depth: 2 , Score: 653.7456840231495\n",
"Max Depth: 3 , Score: 646.4045923317708\n",
Expand Down Expand Up @@ -911,7 +926,7 @@
"dtypes: float64(3197), int64(1)\n",
"memory usage: 124.1 MB\n",
"\n",
"Run Time: 0.02074909210205078 seconds.\n"
"Run Time: 0.038114309310913086 seconds.\n"
]
}
],
Expand All @@ -937,7 +952,7 @@
"output_type": "stream",
"text": [
"Score: 0.9874213836477987\n",
"Run Time: 205.1609354019165 seconds\n"
"Run Time: 304.7109899520874 seconds\n"
]
}
],
Expand Down Expand Up @@ -966,7 +981,7 @@
"output_type": "stream",
"text": [
"Score: 0.9913522012578616\n",
"Run Time: 9.091089010238647 seconds\n"
"Run Time: 29.05471181869507 seconds\n"
]
}
],
Expand All @@ -991,6 +1006,13 @@
"\n",
"print('Run Time: ' + str(elapsed) + ' seconds')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -1009,7 +1031,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.8.3"
}
},
"nbformat": 4,
Expand Down
Git LFS file not shown
4 changes: 2 additions & 2 deletions Chapter_5_Advanced_XGBoost_Unveiled/higgs.model
Git LFS file not shown
Loading

0 comments on commit 7d9383c

Please sign in to comment.