From 4424b5ae5370527069502d1d0dcb6ce0a92d38e0 Mon Sep 17 00:00:00 2001 From: jlgmp Date: Wed, 24 Apr 2024 20:51:10 +0800 Subject: [PATCH 1/4] new chapter and relocation --- open-machine-learning-jupyter-book/_toc.yml | 1 + .../ensemble-learning/bagging.ipynb | 39 +--------------- ...tting-started-with-ensemble-learning.ipynb | 46 +++++++++++++++++++ .../ensemble-learning/stacking.ipynb | 0 4 files changed, 49 insertions(+), 37 deletions(-) create mode 100644 open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/stacking.ipynb diff --git a/open-machine-learning-jupyter-book/_toc.yml b/open-machine-learning-jupyter-book/_toc.yml index d00995ef73..8ee7e5dda8 100644 --- a/open-machine-learning-jupyter-book/_toc.yml +++ b/open-machine-learning-jupyter-book/_toc.yml @@ -80,6 +80,7 @@ parts: sections: - file: ml-advanced/ensemble-learning/bagging - file: ml-advanced/ensemble-learning/random-forest + - file: ml-advanced\ensemble-learning\stacking.ipynb - file: ml-advanced/ensemble-learning/feature-importance - file: ml-advanced/gradient-boosting/introduction-to-gradient-boosting.ipynb sections: diff --git a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb index bf2ddbdc6e..616b150e3f 100644 --- a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb +++ b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb @@ -40,45 +40,10 @@ }, { "cell_type": "markdown", - "id": "f6ca5fc4", + "id": "e605a727", "metadata": {}, "source": [ - "# Bagging\n", - "\n", - "In previous sections, we explored different classification algorithms as well as techniques that can be used to properly validate and evaluate the quality of your models.\n", - "\n", - "Now, suppose that we have chosen the best possible model for a particular problem and are struggling to further improve its accuracy. In this case, we would need to apply some more advanced machine learning techniques that are collectively referred to as *ensembles*.\n", - "\n", - "An *ensemble* is a set of elements that collectively contribute to a whole. A familiar example is a musical ensemble, which blends the sounds of several musical instruments to create harmony, or architectural ensembles, which are a set of buildings designed as a unit. In ensembles, the (whole) harmonious outcome is more important than the performance of any individual part." - ] - }, - { - "cell_type": "markdown", - "id": "4ea30c2c", - "metadata": {}, - "source": [ - "## Ensembles\n", - "\n", - "[Condorcet's jury theorem](https://en.wikipedia.org/wiki/Condorcet%27s_jury_theorem) (1784) is about an ensemble in some sense. It states that, if each member of the jury makes an independent judgment and the probability of the correct decision by each juror is more than 0.5, then the probability of the correct decision by the whole jury increases with the total number of jurors and tends to one. On the other hand, if the probability of being right is less than 0.5 for each juror, then the probability of the correct decision by the whole jury decreases with the number of jurors and tends to zero. \n", - "\n", - "Let's write an analytic expression for this theorem:\n", - "\n", - "- $\\large N$ is the total number of jurors;\n", - "- $\\large m$ is a minimal number of jurors that would make a majority, that is $\\large m = floor(N/2) + 1$;\n", - "- $\\large {N \\choose i}$ is the number of $\\large i$-combinations from a set with $\\large N$ elements.\n", - "- $\\large p$ is the probability of the correct decision by a juror;\n", - "- $\\large \\mu$ is the probability of the correct decision by the whole jury.\n", - "\n", - "Then:\n", - "\n", - "$$ \\large \\mu = \\sum_{i=m}^{N}{N\\choose i}p^i(1-p)^{N-i} $$\n", - "\n", - "It can be seen that if $\\large p > 0.5$, then $\\large \\mu > p$. In addition, if $\\large N \\rightarrow \\infty $, then $\\large \\mu \\rightarrow 1$.\n", - "\n", - "Let's look at another example of ensembles: an observation known as [Wisdom of the crowd](https://en.wikipedia.org/wiki/Wisdom_of_the_crowd). In 1906, [Francis Galton](https://en.wikipedia.org/wiki/Francis_Galton) visited a country fair in Plymouth where he saw a contest being held for farmers. 800 participants tried to estimate the weight of a slaughtered bull. The real weight of the bull was 1198 pounds. Although none of the farmers could guess the exact weight of the animal, the average of their predictions was 1197 pounds.\n", - "\n", - "\n", - "A similar idea for error reduction was adopted in the field of Machine Learning." + "# Bagging\n" ] }, { diff --git a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb index 6c0b29bca8..b95ce127ba 100644 --- a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb +++ b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb @@ -46,6 +46,52 @@ "# Getting started with ensemble learning" ] }, + { + "cell_type": "markdown", + "id": "03655d55", + "metadata": {}, + "source": [ + "In previous sections, we explored different classification algorithms as well as techniques that can be used to properly validate and evaluate the quality of your models.\n", + "\n", + "Now, suppose that we have chosen the best possible model for a particular problem and are struggling to further improve its accuracy. In this case, we would need to apply some more advanced machine learning techniques that are collectively referred to as *ensembles*.\n", + "\n", + "An *ensemble* is a set of elements that collectively contribute to a whole. A familiar example is a musical ensemble, which blends the sounds of several musical instruments to create harmony, or architectural ensembles, which are a set of buildings designed as a unit. In ensembles, the (whole) harmonious outcome is more important than the performance of any individual part." + ] + }, + { + "cell_type": "markdown", + "id": "d56299e0", + "metadata": {}, + "source": [ + "## Ensembles\n", + "\n", + "[Condorcet's jury theorem](https://en.wikipedia.org/wiki/Condorcet%27s_jury_theorem) (1784) is about an ensemble in some sense. It states that, if each member of the jury makes an independent judgment and the probability of the correct decision by each juror is more than 0.5, then the probability of the correct decision by the whole jury increases with the total number of jurors and tends to one. On the other hand, if the probability of being right is less than 0.5 for each juror, then the probability of the correct decision by the whole jury decreases with the number of jurors and tends to zero. \n", + "\n", + "Let's write an analytic expression for this theorem:\n", + "\n", + "- $\\large N$ is the total number of jurors;\n", + "- $\\large m$ is a minimal number of jurors that would make a majority, that is $\\large m = floor(N/2) + 1$;\n", + "- $\\large {N \\choose i}$ is the number of $\\large i$-combinations from a set with $\\large N$ elements.\n", + "- $\\large p$ is the probability of the correct decision by a juror;\n", + "- $\\large \\mu$ is the probability of the correct decision by the whole jury.\n", + "\n", + "Then:\n", + "\n", + "$$ \\large \\mu = \\sum_{i=m}^{N}{N\\choose i}p^i(1-p)^{N-i} $$\n", + "\n", + "It can be seen that if $\\large p > 0.5$, then $\\large \\mu > p$. In addition, if $\\large N \\rightarrow \\infty $, then $\\large \\mu \\rightarrow 1$.\n", + "\n", + "$~~~~~~~$... whenever we are faced with making a decision that has some important consequence, we often seek the opinions of different “experts” to help us make \n", + "$~~~~~~~$ that decision ... \n", + "\n", + "$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$— Page 2, Ensemble Machine Learning, 2012.\n", + "\n", + "Let's look at another example of ensembles: an observation known as [Wisdom of the crowd](https://en.wikipedia.org/wiki/Wisdom_of_the_crowd). In 1906, [Francis Galton](https://en.wikipedia.org/wiki/Francis_Galton) visited a country fair in Plymouth where he saw a contest being held for farmers. 800 participants tried to estimate the weight of a slaughtered bull. The real weight of the bull was 1198 pounds. Although none of the farmers could guess the exact weight of the animal, the average of their predictions was 1197 pounds.\n", + "\n", + "\n", + "A similar idea for error reduction was adopted in the field of Machine Learning." + ] + }, { "cell_type": "code", "execution_count": 2, diff --git a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/stacking.ipynb b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/stacking.ipynb new file mode 100644 index 0000000000..e69de29bb2 From c653f31af3dbb9e9653105a1d5069dd65529bee6 Mon Sep 17 00:00:00 2001 From: jlgmp Date: Wed, 24 Apr 2024 21:00:37 +0800 Subject: [PATCH 2/4] ddd --- open-machine-learning-jupyter-book/_toc.yml | 2 +- .../ensemble-learning/bagging.ipynb | 40 ++++++++++++++- ...tting-started-with-ensemble-learning.ipynb | 49 +------------------ 3 files changed, 41 insertions(+), 50 deletions(-) diff --git a/open-machine-learning-jupyter-book/_toc.yml b/open-machine-learning-jupyter-book/_toc.yml index 8ee7e5dda8..c8ffe4fffe 100644 --- a/open-machine-learning-jupyter-book/_toc.yml +++ b/open-machine-learning-jupyter-book/_toc.yml @@ -80,7 +80,7 @@ parts: sections: - file: ml-advanced/ensemble-learning/bagging - file: ml-advanced/ensemble-learning/random-forest - - file: ml-advanced\ensemble-learning\stacking.ipynb + - file: ml-advanced\ensemble-learning/stacking.ipynb - file: ml-advanced/ensemble-learning/feature-importance - file: ml-advanced/gradient-boosting/introduction-to-gradient-boosting.ipynb sections: diff --git a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb index 616b150e3f..a3382c0b0d 100644 --- a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb +++ b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb @@ -20,6 +20,7 @@ }, { "cell_type": "markdown", + "id": "28bfa3a1", "metadata": { "tags": [ "remove-cell" @@ -40,10 +41,45 @@ }, { "cell_type": "markdown", - "id": "e605a727", + "id": "f6ca5fc4", "metadata": {}, "source": [ - "# Bagging\n" + "# Bagging\n", + "\n", + "In previous sections, we explored different classification algorithms as well as techniques that can be used to properly validate and evaluate the quality of your models.\n", + "\n", + "Now, suppose that we have chosen the best possible model for a particular problem and are struggling to further improve its accuracy. In this case, we would need to apply some more advanced machine learning techniques that are collectively referred to as *ensembles*.\n", + "\n", + "An *ensemble* is a set of elements that collectively contribute to a whole. A familiar example is a musical ensemble, which blends the sounds of several musical instruments to create harmony, or architectural ensembles, which are a set of buildings designed as a unit. In ensembles, the (whole) harmonious outcome is more important than the performance of any individual part." + ] + }, + { + "cell_type": "markdown", + "id": "4ea30c2c", + "metadata": {}, + "source": [ + "## Ensembles\n", + "\n", + "[Condorcet's jury theorem](https://en.wikipedia.org/wiki/Condorcet%27s_jury_theorem) (1784) is about an ensemble in some sense. It states that, if each member of the jury makes an independent judgment and the probability of the correct decision by each juror is more than 0.5, then the probability of the correct decision by the whole jury increases with the total number of jurors and tends to one. On the other hand, if the probability of being right is less than 0.5 for each juror, then the probability of the correct decision by the whole jury decreases with the number of jurors and tends to zero. \n", + "\n", + "Let's write an analytic expression for this theorem:\n", + "\n", + "- $\\large N$ is the total number of jurors;\n", + "- $\\large m$ is a minimal number of jurors that would make a majority, that is $\\large m = floor(N/2) + 1$;\n", + "- $\\large {N \\choose i}$ is the number of $\\large i$-combinations from a set with $\\large N$ elements.\n", + "- $\\large p$ is the probability of the correct decision by a juror;\n", + "- $\\large \\mu$ is the probability of the correct decision by the whole jury.\n", + "\n", + "Then:\n", + "\n", + "$$ \\large \\mu = \\sum_{i=m}^{N}{N\\choose i}p^i(1-p)^{N-i} $$\n", + "\n", + "It can be seen that if $\\large p > 0.5$, then $\\large \\mu > p$. In addition, if $\\large N \\rightarrow \\infty $, then $\\large \\mu \\rightarrow 1$.\n", + "\n", + "Let's look at another example of ensembles: an observation known as [Wisdom of the crowd](https://en.wikipedia.org/wiki/Wisdom_of_the_crowd). In 1906, [Francis Galton](https://en.wikipedia.org/wiki/Francis_Galton) visited a country fair in Plymouth where he saw a contest being held for farmers. 800 participants tried to estimate the weight of a slaughtered bull. The real weight of the bull was 1198 pounds. Although none of the farmers could guess the exact weight of the animal, the average of their predictions was 1197 pounds.\n", + "\n", + "\n", + "A similar idea for error reduction was adopted in the field of Machine Learning." ] }, { diff --git a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb index b95ce127ba..62c149bda9 100644 --- a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb +++ b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "b3953cf0-8228-4b81-b5d9-d3249228f011", "metadata": { "tags": [ @@ -20,6 +20,7 @@ }, { "cell_type": "markdown", + "id": "4eb207a7", "metadata": { "tags": [ "remove-cell" @@ -46,52 +47,6 @@ "# Getting started with ensemble learning" ] }, - { - "cell_type": "markdown", - "id": "03655d55", - "metadata": {}, - "source": [ - "In previous sections, we explored different classification algorithms as well as techniques that can be used to properly validate and evaluate the quality of your models.\n", - "\n", - "Now, suppose that we have chosen the best possible model for a particular problem and are struggling to further improve its accuracy. In this case, we would need to apply some more advanced machine learning techniques that are collectively referred to as *ensembles*.\n", - "\n", - "An *ensemble* is a set of elements that collectively contribute to a whole. A familiar example is a musical ensemble, which blends the sounds of several musical instruments to create harmony, or architectural ensembles, which are a set of buildings designed as a unit. In ensembles, the (whole) harmonious outcome is more important than the performance of any individual part." - ] - }, - { - "cell_type": "markdown", - "id": "d56299e0", - "metadata": {}, - "source": [ - "## Ensembles\n", - "\n", - "[Condorcet's jury theorem](https://en.wikipedia.org/wiki/Condorcet%27s_jury_theorem) (1784) is about an ensemble in some sense. It states that, if each member of the jury makes an independent judgment and the probability of the correct decision by each juror is more than 0.5, then the probability of the correct decision by the whole jury increases with the total number of jurors and tends to one. On the other hand, if the probability of being right is less than 0.5 for each juror, then the probability of the correct decision by the whole jury decreases with the number of jurors and tends to zero. \n", - "\n", - "Let's write an analytic expression for this theorem:\n", - "\n", - "- $\\large N$ is the total number of jurors;\n", - "- $\\large m$ is a minimal number of jurors that would make a majority, that is $\\large m = floor(N/2) + 1$;\n", - "- $\\large {N \\choose i}$ is the number of $\\large i$-combinations from a set with $\\large N$ elements.\n", - "- $\\large p$ is the probability of the correct decision by a juror;\n", - "- $\\large \\mu$ is the probability of the correct decision by the whole jury.\n", - "\n", - "Then:\n", - "\n", - "$$ \\large \\mu = \\sum_{i=m}^{N}{N\\choose i}p^i(1-p)^{N-i} $$\n", - "\n", - "It can be seen that if $\\large p > 0.5$, then $\\large \\mu > p$. In addition, if $\\large N \\rightarrow \\infty $, then $\\large \\mu \\rightarrow 1$.\n", - "\n", - "$~~~~~~~$... whenever we are faced with making a decision that has some important consequence, we often seek the opinions of different “experts” to help us make \n", - "$~~~~~~~$ that decision ... \n", - "\n", - "$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$— Page 2, Ensemble Machine Learning, 2012.\n", - "\n", - "Let's look at another example of ensembles: an observation known as [Wisdom of the crowd](https://en.wikipedia.org/wiki/Wisdom_of_the_crowd). In 1906, [Francis Galton](https://en.wikipedia.org/wiki/Francis_Galton) visited a country fair in Plymouth where he saw a contest being held for farmers. 800 participants tried to estimate the weight of a slaughtered bull. The real weight of the bull was 1198 pounds. Although none of the farmers could guess the exact weight of the animal, the average of their predictions was 1197 pounds.\n", - "\n", - "\n", - "A similar idea for error reduction was adopted in the field of Machine Learning." - ] - }, { "cell_type": "code", "execution_count": 2, From d1f9ebd564d7ea594c744a1845be388ebec5b8dc Mon Sep 17 00:00:00 2001 From: jlgmp Date: Wed, 24 Apr 2024 21:09:04 +0800 Subject: [PATCH 3/4] ddd --- .../ensemble-learning/bagging.ipynb | 37 +------------- ...tting-started-with-ensemble-learning.ipynb | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 36 deletions(-) diff --git a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb index a3382c0b0d..f90b3e398d 100644 --- a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb +++ b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb @@ -44,42 +44,7 @@ "id": "f6ca5fc4", "metadata": {}, "source": [ - "# Bagging\n", - "\n", - "In previous sections, we explored different classification algorithms as well as techniques that can be used to properly validate and evaluate the quality of your models.\n", - "\n", - "Now, suppose that we have chosen the best possible model for a particular problem and are struggling to further improve its accuracy. In this case, we would need to apply some more advanced machine learning techniques that are collectively referred to as *ensembles*.\n", - "\n", - "An *ensemble* is a set of elements that collectively contribute to a whole. A familiar example is a musical ensemble, which blends the sounds of several musical instruments to create harmony, or architectural ensembles, which are a set of buildings designed as a unit. In ensembles, the (whole) harmonious outcome is more important than the performance of any individual part." - ] - }, - { - "cell_type": "markdown", - "id": "4ea30c2c", - "metadata": {}, - "source": [ - "## Ensembles\n", - "\n", - "[Condorcet's jury theorem](https://en.wikipedia.org/wiki/Condorcet%27s_jury_theorem) (1784) is about an ensemble in some sense. It states that, if each member of the jury makes an independent judgment and the probability of the correct decision by each juror is more than 0.5, then the probability of the correct decision by the whole jury increases with the total number of jurors and tends to one. On the other hand, if the probability of being right is less than 0.5 for each juror, then the probability of the correct decision by the whole jury decreases with the number of jurors and tends to zero. \n", - "\n", - "Let's write an analytic expression for this theorem:\n", - "\n", - "- $\\large N$ is the total number of jurors;\n", - "- $\\large m$ is a minimal number of jurors that would make a majority, that is $\\large m = floor(N/2) + 1$;\n", - "- $\\large {N \\choose i}$ is the number of $\\large i$-combinations from a set with $\\large N$ elements.\n", - "- $\\large p$ is the probability of the correct decision by a juror;\n", - "- $\\large \\mu$ is the probability of the correct decision by the whole jury.\n", - "\n", - "Then:\n", - "\n", - "$$ \\large \\mu = \\sum_{i=m}^{N}{N\\choose i}p^i(1-p)^{N-i} $$\n", - "\n", - "It can be seen that if $\\large p > 0.5$, then $\\large \\mu > p$. In addition, if $\\large N \\rightarrow \\infty $, then $\\large \\mu \\rightarrow 1$.\n", - "\n", - "Let's look at another example of ensembles: an observation known as [Wisdom of the crowd](https://en.wikipedia.org/wiki/Wisdom_of_the_crowd). In 1906, [Francis Galton](https://en.wikipedia.org/wiki/Francis_Galton) visited a country fair in Plymouth where he saw a contest being held for farmers. 800 participants tried to estimate the weight of a slaughtered bull. The real weight of the bull was 1198 pounds. Although none of the farmers could guess the exact weight of the animal, the average of their predictions was 1197 pounds.\n", - "\n", - "\n", - "A similar idea for error reduction was adopted in the field of Machine Learning." + "# Bagging" ] }, { diff --git a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb index 62c149bda9..3943217cc3 100644 --- a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb +++ b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/getting-started-with-ensemble-learning.ipynb @@ -47,6 +47,54 @@ "# Getting started with ensemble learning" ] }, + { + "cell_type": "markdown", + "id": "239f071d", + "metadata": {}, + "source": [ + "In previous sections, we explored different classification algorithms as well as techniques that can be used to properly validate and evaluate the quality of your models.\n", + "\n", + "Now, suppose that we have chosen the best possible model for a particular problem and are struggling to further improve its accuracy. In this case, we would need to apply some more advanced machine learning techniques that are collectively referred to as *ensembles*.\n", + "\n", + "An *ensemble* is a set of elements that collectively contribute to a whole. A familiar example is a musical ensemble, which blends the sounds of several musical instruments to create harmony, or architectural ensembles, which are a set of buildings designed as a unit. In ensembles, the (whole) harmonious outcome is more important than the performance of any individual part." + ] + }, + { + "cell_type": "markdown", + "id": "2eff740a", + "metadata": {}, + "source": [ + "## Ensembles\n", + "\n", + "[Condorcet's jury theorem](https://en.wikipedia.org/wiki/Condorcet%27s_jury_theorem) (1784) is about an ensemble in some sense. It states that, if each member of the jury makes an independent judgment and the probability of the correct decision by each juror is more than 0.5, then the probability of the correct decision by the whole jury increases with the total number of jurors and tends to one. On the other hand, if the probability of being right is less than 0.5 for each juror, then the probability of the correct decision by the whole jury decreases with the number of jurors and tends to zero. \n", + "\n", + "Let's write an analytic expression for this theorem:\n", + "\n", + "- $\\large N$ is the total number of jurors;\n", + "- $\\large m$ is a minimal number of jurors that would make a majority, that is $\\large m = floor(N/2) + 1$;\n", + "- $\\large {N \\choose i}$ is the number of $\\large i$-combinations from a set with $\\large N$ elements.\n", + "- $\\large p$ is the probability of the correct decision by a juror;\n", + "- $\\large \\mu$ is the probability of the correct decision by the whole jury.\n", + "\n", + "Then:\n", + "\n", + "$$ \\large \\mu = \\sum_{i=m}^{N}{N\\choose i}p^i(1-p)^{N-i} $$\n", + "\n", + "It can be seen that if $\\large p > 0.5$, then $\\large \\mu > p$. In addition, if $\\large N \\rightarrow \\infty $, then $\\large \\mu \\rightarrow 1$.\n", + "\n", + "$~~~~~~~$... whenever we are faced with making a decision that has some important consequence, we often seek the opinions of different “experts” \n", + "\n", + "$~~~~~~$ to help us that decision ...\n", + "\n", + "\n", + "$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$ — Page 2, Ensemble Machine Learning, 2012.\n", + "\n", + "Let's look at another example of ensembles: an observation known as [Wisdom of the crowd](https://en.wikipedia.org/wiki/Wisdom_of_the_crowd). In 1906, [Francis Galton](https://en.wikipedia.org/wiki/Francis_Galton) visited a country fair in Plymouth where he saw a contest being held for farmers. 800 participants tried to estimate the weight of a slaughtered bull. The real weight of the bull was 1198 pounds. Although none of the farmers could guess the exact weight of the animal, the average of their predictions was 1197 pounds.\n", + "\n", + "\n", + "A similar idea for error reduction was adopted in the field of Machine Learning." + ] + }, { "cell_type": "code", "execution_count": 2, From 284c768eaa1992ff8b831756ed538a9a4e3adc13 Mon Sep 17 00:00:00 2001 From: jlgmp Date: Wed, 24 Apr 2024 21:13:41 +0800 Subject: [PATCH 4/4] ddd --- .../ml-advanced/ensemble-learning/bagging.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb index f90b3e398d..d5c90276ee 100644 --- a/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb +++ b/open-machine-learning-jupyter-book/ml-advanced/ensemble-learning/bagging.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "8aec88d2-8c79-452c-927b-17253668a176", "metadata": { "tags": [ @@ -366,7 +366,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -693,7 +693,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.18" + "version": "3.9.19" } }, "nbformat": 4,