This commit is contained in:
mhjensen
2020-11-05 11:51:29 +01:00
parent 43a7c70ca1
commit 0774f10a39
40 changed files with 154 additions and 412 deletions
+4 -4
View File
@@ -141,7 +141,7 @@ plt.show()
!split
===== Using the Voting Classifier =====
We can use the voting classifier on other data sets, here the excting binary case of two distinct objects using the make moons functionality of -Scikit-Learn-.
We can use the voting classifier on other data sets, here the exciting binary case of two distinct objects using the make moons functionality of _Scikit-Learn_.
!bc pycod
from sklearn.model_selection import train_test_split
from sklearn.datasets import make_moons
@@ -192,7 +192,7 @@ for clf in (log_clf, rnd_clf, svm_clf, voting_clf):
!split
===== Please, not the moons again! Voting and Bagging =====
===== Voting and Bagging =====
!bc pycod
from sklearn.model_selection import train_test_split
@@ -295,10 +295,10 @@ The algorithm described here can be applied to both classification and regressio
We will grow of forest of say $B$ trees.
o For $b=1:B$
* Draw a bootstrap sample of from the training data organized in our $\bm{X}$ matrix.
* Draw a bootstrap sample from the training data organized in our $\bm{X}$ matrix.
* We grow then a random forest tree $T_b$ based on the bootstrapped data by repeating the steps outlined till we reach the maximum node size is reached
o we select $m \le p$ variables at random from the $p$ predictors/features
o pick the best split point among the $m$ features using either the CART algorithm or the ID3 for classification and create a new node
o pick the best split point among the $m$ features using for example the CART algorithm and create a new node
o split the node into daughter nodes
o Output then the ensemble of trees $\{T_b\}_1^{B}$ and make predictions for either a regression type of problem or a classification type of problem.