diff --git a/doc/pub/week34/html/._week34-bs000.html b/doc/pub/week34/html/._week34-bs000.html index 83ac6fd24..6e80662a5 100644 --- a/doc/pub/week34/html/._week34-bs000.html +++ b/doc/pub/week34/html/._week34-bs000.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs001.html b/doc/pub/week34/html/._week34-bs001.html index da573ec08..8b12b4254 100644 --- a/doc/pub/week34/html/._week34-bs001.html +++ b/doc/pub/week34/html/._week34-bs001.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs002.html b/doc/pub/week34/html/._week34-bs002.html index c541b596f..1bf8f0c03 100644 --- a/doc/pub/week34/html/._week34-bs002.html +++ b/doc/pub/week34/html/._week34-bs002.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs003.html b/doc/pub/week34/html/._week34-bs003.html index aa2ad653f..c16a951f4 100644 --- a/doc/pub/week34/html/._week34-bs003.html +++ b/doc/pub/week34/html/._week34-bs003.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs004.html b/doc/pub/week34/html/._week34-bs004.html index 9bd120809..cae791f9a 100644 --- a/doc/pub/week34/html/._week34-bs004.html +++ b/doc/pub/week34/html/._week34-bs004.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs005.html b/doc/pub/week34/html/._week34-bs005.html index 6b9e29264..8a7ffd83c 100644 --- a/doc/pub/week34/html/._week34-bs005.html +++ b/doc/pub/week34/html/._week34-bs005.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs006.html b/doc/pub/week34/html/._week34-bs006.html index 97268d195..817c68715 100644 --- a/doc/pub/week34/html/._week34-bs006.html +++ b/doc/pub/week34/html/._week34-bs006.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs007.html b/doc/pub/week34/html/._week34-bs007.html index 810c57893..2b4307912 100644 --- a/doc/pub/week34/html/._week34-bs007.html +++ b/doc/pub/week34/html/._week34-bs007.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs008.html b/doc/pub/week34/html/._week34-bs008.html index ee3b95108..6e92796fb 100644 --- a/doc/pub/week34/html/._week34-bs008.html +++ b/doc/pub/week34/html/._week34-bs008.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs009.html b/doc/pub/week34/html/._week34-bs009.html index c20b45c67..b669e82eb 100644 --- a/doc/pub/week34/html/._week34-bs009.html +++ b/doc/pub/week34/html/._week34-bs009.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs010.html b/doc/pub/week34/html/._week34-bs010.html index 995f6bf97..be858d636 100644 --- a/doc/pub/week34/html/._week34-bs010.html +++ b/doc/pub/week34/html/._week34-bs010.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs011.html b/doc/pub/week34/html/._week34-bs011.html index 88f4d9c0c..b10db317a 100644 --- a/doc/pub/week34/html/._week34-bs011.html +++ b/doc/pub/week34/html/._week34-bs011.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs012.html b/doc/pub/week34/html/._week34-bs012.html index 95b7cfecf..46da91b57 100644 --- a/doc/pub/week34/html/._week34-bs012.html +++ b/doc/pub/week34/html/._week34-bs012.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs013.html b/doc/pub/week34/html/._week34-bs013.html index 67ec9b786..b370dad31 100644 --- a/doc/pub/week34/html/._week34-bs013.html +++ b/doc/pub/week34/html/._week34-bs013.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs014.html b/doc/pub/week34/html/._week34-bs014.html index dd82e18f2..a1a952d12 100644 --- a/doc/pub/week34/html/._week34-bs014.html +++ b/doc/pub/week34/html/._week34-bs014.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs015.html b/doc/pub/week34/html/._week34-bs015.html index ee803f1cf..8dd9b0a83 100644 --- a/doc/pub/week34/html/._week34-bs015.html +++ b/doc/pub/week34/html/._week34-bs015.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs016.html b/doc/pub/week34/html/._week34-bs016.html index f230f4484..c5f908917 100644 --- a/doc/pub/week34/html/._week34-bs016.html +++ b/doc/pub/week34/html/._week34-bs016.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs017.html b/doc/pub/week34/html/._week34-bs017.html index f3d582f02..691676e83 100644 --- a/doc/pub/week34/html/._week34-bs017.html +++ b/doc/pub/week34/html/._week34-bs017.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs018.html b/doc/pub/week34/html/._week34-bs018.html index 338b631e9..7fb7bf762 100644 --- a/doc/pub/week34/html/._week34-bs018.html +++ b/doc/pub/week34/html/._week34-bs018.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs019.html b/doc/pub/week34/html/._week34-bs019.html index 4ac64f02e..d2b4c5539 100644 --- a/doc/pub/week34/html/._week34-bs019.html +++ b/doc/pub/week34/html/._week34-bs019.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs020.html b/doc/pub/week34/html/._week34-bs020.html index 59f0926ed..121fa81f8 100644 --- a/doc/pub/week34/html/._week34-bs020.html +++ b/doc/pub/week34/html/._week34-bs020.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs021.html b/doc/pub/week34/html/._week34-bs021.html index 430c21a9c..e379dc334 100644 --- a/doc/pub/week34/html/._week34-bs021.html +++ b/doc/pub/week34/html/._week34-bs021.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs022.html b/doc/pub/week34/html/._week34-bs022.html index 4654e95a8..2cdbac904 100644 --- a/doc/pub/week34/html/._week34-bs022.html +++ b/doc/pub/week34/html/._week34-bs022.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs023.html b/doc/pub/week34/html/._week34-bs023.html index 44529fd50..b3d7af6f7 100644 --- a/doc/pub/week34/html/._week34-bs023.html +++ b/doc/pub/week34/html/._week34-bs023.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs024.html b/doc/pub/week34/html/._week34-bs024.html index 03f7f94a8..b8c30fa3f 100644 --- a/doc/pub/week34/html/._week34-bs024.html +++ b/doc/pub/week34/html/._week34-bs024.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs025.html b/doc/pub/week34/html/._week34-bs025.html index afe39c9f2..a7983d8b6 100644 --- a/doc/pub/week34/html/._week34-bs025.html +++ b/doc/pub/week34/html/._week34-bs025.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs026.html b/doc/pub/week34/html/._week34-bs026.html index 6607ccb25..a33e4abe7 100644 --- a/doc/pub/week34/html/._week34-bs026.html +++ b/doc/pub/week34/html/._week34-bs026.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs027.html b/doc/pub/week34/html/._week34-bs027.html index de4d779b5..790fead42 100644 --- a/doc/pub/week34/html/._week34-bs027.html +++ b/doc/pub/week34/html/._week34-bs027.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs028.html b/doc/pub/week34/html/._week34-bs028.html index b48e0586d..f6520ace2 100644 --- a/doc/pub/week34/html/._week34-bs028.html +++ b/doc/pub/week34/html/._week34-bs028.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs029.html b/doc/pub/week34/html/._week34-bs029.html index 55b27b4f1..69dd84cf2 100644 --- a/doc/pub/week34/html/._week34-bs029.html +++ b/doc/pub/week34/html/._week34-bs029.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs030.html b/doc/pub/week34/html/._week34-bs030.html index b5734a5ed..73a9fe1e0 100644 --- a/doc/pub/week34/html/._week34-bs030.html +++ b/doc/pub/week34/html/._week34-bs030.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs031.html b/doc/pub/week34/html/._week34-bs031.html index 5f4b008cc..6e39114c2 100644 --- a/doc/pub/week34/html/._week34-bs031.html +++ b/doc/pub/week34/html/._week34-bs031.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs032.html b/doc/pub/week34/html/._week34-bs032.html index dccd1f57a..56a276103 100644 --- a/doc/pub/week34/html/._week34-bs032.html +++ b/doc/pub/week34/html/._week34-bs032.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/._week34-bs033.html b/doc/pub/week34/html/._week34-bs033.html index 24f0d88b8..944b9a628 100644 --- a/doc/pub/week34/html/._week34-bs033.html +++ b/doc/pub/week34/html/._week34-bs033.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/week34-bs.html b/doc/pub/week34/html/week34-bs.html index 83ac6fd24..6e80662a5 100644 --- a/doc/pub/week34/html/week34-bs.html +++ b/doc/pub/week34/html/week34-bs.html @@ -144,6 +144,7 @@ Automatically generated HTML file from DocOnce source None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -151,7 +152,11 @@ Automatically generated HTML file from DocOnce source ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -232,8 +237,10 @@ MathJax.Hub.Config({
  •    Seeing the wood for the trees
  •    And what about using neural networks?
  • A first summary
  • +
  • Exercises for week 36
  • Exercise 1: Setting up various Python environments
  • Exercise 2: making your own data and exploring scikit-learn
  • +
  • Exercise 3: Normalizing our data
  • diff --git a/doc/pub/week34/html/week34-reveal.html b/doc/pub/week34/html/week34-reveal.html index 262e19aea..aee4372b9 100644 --- a/doc/pub/week34/html/week34-reveal.html +++ b/doc/pub/week34/html/week34-reveal.html @@ -2175,6 +2175,8 @@ Now it is time to dive more into the details of various methods. We will start w
    +

    Exercises for week 36

    +Here are three possible exercises for week 36 and the lab sessions of Wednesday September 1..

    @@ -2262,7 +2264,7 @@ analysis environment, available for free and under a commercial license.

    -We recommend using Anaconda. +We recommend using Anaconda if you are not too familiar with setting paths in a terminal environment.

    @@ -2282,7 +2284,7 @@ The following simple Python instructions define our \( x \) and \( y \) values ( y = 2.0+5*x*x+0.1*np.random.randn(100,1)

      -

    1. Write your own code (following the examples under the regression slides) for computing the parametrization of the data set fitting a second-order polynomial.
    2. +

    3. Write your own code (following the examples under the regression notes) for computing the parametrization of the data set fitting a second-order polynomial.
    4. Use thereafter scikit-learn (see again the examples in the regression slides) and compare with your own code.
    5. Using scikit-learn, compute also the mean square error, a risk metric corresponding to the expected value of the squared (quadratic) error defined as
    6. @@ -2362,6 +2364,117 @@ ypredict = X_test @ beta

      +

      + + +

      + + +

      Exercise 3: Normalizing our data

      + +

      +A much used approach before starting to train the data is to preprocess our +data. Normally the data may need a rescaling and/or may be sensitive +to extreme values. Scaling the data renders our inputs much more +suitable for the algorithms we want to employ. + +

      +Scikit-Learn has several functions which allow us to rescale the +data, normally resulting in much better results in terms of various +accuracy scores. The StandardScaler function in Scikit-Learn +ensures that for each feature/predictor we study the mean value is +zero and the variance is one (every column in the design/feature +matrix). This scaling has the drawback that it does not ensure that +we have a particular maximum or minimum in our data set. Another +function included in Scikit-Learn is the MinMaxScaler which +ensures that all features are exactly between \( 0 \) and \( 1 \). The + +

      +The Normalizer scales each data +point such that the feature vector has a euclidean length of one. In other words, it +projects a data point on the circle (or sphere in the case of higher dimensions) with a +radius of 1. This means every data point is scaled by a different number (by the +inverse of it’s length). +This normalization is often used when only the direction (or angle) of the data matters, +not the length of the feature vector. + +

      +The RobustScaler works similarly to the StandardScaler in that it +ensures statistical properties for each feature that guarantee that +they are on the same scale. However, the RobustScaler uses the median +and quartiles, instead of mean and variance. This makes the +RobustScaler ignore data points that are very different from the rest +(like measurement errors). These odd data points are also called +outliers, and might often lead to trouble for other scaling +techniques. + +

      +It also common to split the data in a training set and a testing set. A typical split is to use \( 80\% \) of the data for training and the rest +for testing. This can be done as follows with our design matrix \( \boldsymbol{X} \) and data \( \boldsymbol{y} \) (remember to import scikit-learn) +

      + + +

      # split in training and test data
      +X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.2)
      +
      +

      +Then we can use the standard scaler to scale our data as +

      + + +

      scaler = StandardScaler()
      +scaler.fit(X_train)
      +X_train_scaled = scaler.transform(X_train)
      +X_test_scaled = scaler.transform(X_test)
      +
      +

      +In this exercise we want you to to compute the MSE for the training +data and the test data as function of the complexity of a polynomial, +that is the degree of a given polynomial. We want you also to compute the \( R2 \) score as function of the complexity of the model for both training data and test data. You should also run the calculation with and without scaling. + +

      +One of +the aims is to reproduce Figure 2.11 of Hastie et al. + +

      +Our data is defined by \( x\in [-3,3] \) with a total of for example \( 100 \) data points. +

      + + +

      np.random.seed()
      +n = 100
      +maxdegree = 14
      +# Make data set.
      +x = np.linspace(-3, 3, n).reshape(-1, 1)
      +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape)
      +
      +

      +where \( y \) is the function we want to fit with a given polynomial. + +

      +a) +Write a first code which sets up a design matrix \( X \) defined by a fifth-order polynomial. Scale your data and split it in training and test data. + +

      +b) +Perform an ordinary least squares and compute the means squared error and the \( R2 \) factor for the training data and the test data, with and without scaling. + +

      + +Solution. +This requires a simple extension to the above code where you simply add a statement calling the \( R2 \) function included in the same code. + + +

      +c) +Add now a model which allows you to make polynomials up to degree \( 15 \). Perform a standard OLS fitting of the training data and compute the MSE and \( R2 \) for the training and test data and plot both test and training data MSE and \( R2 \) as functions of the polynomial degree. Compare what you see with Figure 2.11 of Hastie et al. Comment your results. For which polynomial degree do you find an optimal MSE (smallest value)? + +

      + +Solution. +Here you simply need to change the degree of the polynomial in the above code to \( n=15 \). + +

    diff --git a/doc/pub/week34/html/week34-solarized.html b/doc/pub/week34/html/week34-solarized.html index 550f27dd5..3ad4cd330 100644 --- a/doc/pub/week34/html/week34-solarized.html +++ b/doc/pub/week34/html/week34-solarized.html @@ -164,6 +164,7 @@ div { text-align: justify; text-justify: inter-word; } None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -171,7 +172,11 @@ div { text-align: justify; text-justify: inter-word; } ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -2156,6 +2161,9 @@ Now it is time to dive more into the details of various methods. We will start w











    +

    Exercises for week 36

    +Here are three possible exercises for week 36 and the lab sessions of Wednesday September 1.. +

    @@ -2236,7 +2244,7 @@ analysis environment, available for free and under a commercial license.

    -We recommend using Anaconda. +We recommend using Anaconda if you are not too familiar with setting paths in a terminal environment.

    @@ -2256,7 +2264,7 @@ The following simple Python instructions define our \( x \) and \( y \) values ( y = 2.0+5*x*x+0.1*np.random.randn(100,1)

      -
    1. Write your own code (following the examples under the regression slides) for computing the parametrization of the data set fitting a second-order polynomial.
    2. +
    3. Write your own code (following the examples under the regression notes) for computing the parametrization of the data set fitting a second-order polynomial.
    4. Use thereafter scikit-learn (see again the examples in the regression slides) and compare with your own code.
    5. Using scikit-learn, compute also the mean square error, a risk metric corresponding to the expected value of the squared (quadratic) error defined as
    @@ -2333,6 +2341,117 @@ ypredict = X_test @ beta

    +

    + + +

    Exercise 3: Normalizing our data

    + +

    +A much used approach before starting to train the data is to preprocess our +data. Normally the data may need a rescaling and/or may be sensitive +to extreme values. Scaling the data renders our inputs much more +suitable for the algorithms we want to employ. + +

    +Scikit-Learn has several functions which allow us to rescale the +data, normally resulting in much better results in terms of various +accuracy scores. The StandardScaler function in Scikit-Learn +ensures that for each feature/predictor we study the mean value is +zero and the variance is one (every column in the design/feature +matrix). This scaling has the drawback that it does not ensure that +we have a particular maximum or minimum in our data set. Another +function included in Scikit-Learn is the MinMaxScaler which +ensures that all features are exactly between \( 0 \) and \( 1 \). The + +

    +The Normalizer scales each data +point such that the feature vector has a euclidean length of one. In other words, it +projects a data point on the circle (or sphere in the case of higher dimensions) with a +radius of 1. This means every data point is scaled by a different number (by the +inverse of it’s length). +This normalization is often used when only the direction (or angle) of the data matters, +not the length of the feature vector. + +

    +The RobustScaler works similarly to the StandardScaler in that it +ensures statistical properties for each feature that guarantee that +they are on the same scale. However, the RobustScaler uses the median +and quartiles, instead of mean and variance. This makes the +RobustScaler ignore data points that are very different from the rest +(like measurement errors). These odd data points are also called +outliers, and might often lead to trouble for other scaling +techniques. + +

    +It also common to split the data in a training set and a testing set. A typical split is to use \( 80\% \) of the data for training and the rest +for testing. This can be done as follows with our design matrix \( \boldsymbol{X} \) and data \( \boldsymbol{y} \) (remember to import scikit-learn) +

    + + +

    # split in training and test data
    +X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.2)
    +
    +

    +Then we can use the standard scaler to scale our data as +

    + + +

    scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +
    +

    +In this exercise we want you to to compute the MSE for the training +data and the test data as function of the complexity of a polynomial, +that is the degree of a given polynomial. We want you also to compute the \( R2 \) score as function of the complexity of the model for both training data and test data. You should also run the calculation with and without scaling. + +

    +One of +the aims is to reproduce Figure 2.11 of Hastie et al. + +

    +Our data is defined by \( x\in [-3,3] \) with a total of for example \( 100 \) data points. +

    + + +

    np.random.seed()
    +n = 100
    +maxdegree = 14
    +# Make data set.
    +x = np.linspace(-3, 3, n).reshape(-1, 1)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape)
    +
    +

    +where \( y \) is the function we want to fit with a given polynomial. + +

    +a) +Write a first code which sets up a design matrix \( X \) defined by a fifth-order polynomial. Scale your data and split it in training and test data. + +

    +b) +Perform an ordinary least squares and compute the means squared error and the \( R2 \) factor for the training data and the test data, with and without scaling. + +

    + +Solution. +This requires a simple extension to the above code where you simply add a statement calling the \( R2 \) function included in the same code. + + +

    +c) +Add now a model which allows you to make polynomials up to degree \( 15 \). Perform a standard OLS fitting of the training data and compute the MSE and \( R2 \) for the training and test data and plot both test and training data MSE and \( R2 \) as functions of the polynomial degree. Compare what you see with Figure 2.11 of Hastie et al. Comment your results. For which polynomial degree do you find an optimal MSE (smallest value)? + +

    + +Solution. +Here you simply need to change the degree of the polynomial in the above code to \( n=15 \). + + +

    + + diff --git a/doc/pub/week34/html/week34.html b/doc/pub/week34/html/week34.html index 8d431a547..8858176d6 100644 --- a/doc/pub/week34/html/week34.html +++ b/doc/pub/week34/html/week34.html @@ -169,6 +169,7 @@ div { text-align: justify; text-justify: inter-word; } None, 'and-what-about-using-neural-networks'), ('A first summary', 2, None, 'a-first-summary'), + ('Exercises for week 36', 2, None, 'exercises-for-week-36'), ('Exercise 1: Setting up various Python environments', 2, None, @@ -176,7 +177,11 @@ div { text-align: justify; text-justify: inter-word; } ('Exercise 2: making your own data and exploring scikit-learn', 2, None, - 'exercise-2-making-your-own-data-and-exploring-scikit-learn')]} + 'exercise-2-making-your-own-data-and-exploring-scikit-learn'), + ('Exercise 3: Normalizing our data', + 2, + None, + 'exercise-3-normalizing-our-data')]} end of tocinfo --> @@ -2161,6 +2166,9 @@ Now it is time to dive more into the details of various methods. We will start w











    +

    Exercises for week 36

    +Here are three possible exercises for week 36 and the lab sessions of Wednesday September 1.. +

    @@ -2241,7 +2249,7 @@ analysis environment, available for free and under a commercial license.

    -We recommend using Anaconda. +We recommend using Anaconda if you are not too familiar with setting paths in a terminal environment.

    @@ -2261,7 +2269,7 @@ The following simple Python instructions define our \( x \) and \( y \) values ( y = 2.0+5*x*x+0.1*np.random.randn(100,1)

      -
    1. Write your own code (following the examples under the regression slides) for computing the parametrization of the data set fitting a second-order polynomial.
    2. +
    3. Write your own code (following the examples under the regression notes) for computing the parametrization of the data set fitting a second-order polynomial.
    4. Use thereafter scikit-learn (see again the examples in the regression slides) and compare with your own code.
    5. Using scikit-learn, compute also the mean square error, a risk metric corresponding to the expected value of the squared (quadratic) error defined as
    @@ -2338,6 +2346,117 @@ ypredict = X_test Exercise 3: Normalizing our data + +

    +A much used approach before starting to train the data is to preprocess our +data. Normally the data may need a rescaling and/or may be sensitive +to extreme values. Scaling the data renders our inputs much more +suitable for the algorithms we want to employ. + +

    +Scikit-Learn has several functions which allow us to rescale the +data, normally resulting in much better results in terms of various +accuracy scores. The StandardScaler function in Scikit-Learn +ensures that for each feature/predictor we study the mean value is +zero and the variance is one (every column in the design/feature +matrix). This scaling has the drawback that it does not ensure that +we have a particular maximum or minimum in our data set. Another +function included in Scikit-Learn is the MinMaxScaler which +ensures that all features are exactly between \( 0 \) and \( 1 \). The + +

    +The Normalizer scales each data +point such that the feature vector has a euclidean length of one. In other words, it +projects a data point on the circle (or sphere in the case of higher dimensions) with a +radius of 1. This means every data point is scaled by a different number (by the +inverse of it’s length). +This normalization is often used when only the direction (or angle) of the data matters, +not the length of the feature vector. + +

    +The RobustScaler works similarly to the StandardScaler in that it +ensures statistical properties for each feature that guarantee that +they are on the same scale. However, the RobustScaler uses the median +and quartiles, instead of mean and variance. This makes the +RobustScaler ignore data points that are very different from the rest +(like measurement errors). These odd data points are also called +outliers, and might often lead to trouble for other scaling +techniques. + +

    +It also common to split the data in a training set and a testing set. A typical split is to use \( 80\% \) of the data for training and the rest +for testing. This can be done as follows with our design matrix \( \boldsymbol{X} \) and data \( \boldsymbol{y} \) (remember to import scikit-learn) +

    + + +

    # split in training and test data
    +X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.2)
    +
    +

    +Then we can use the standard scaler to scale our data as +

    + + +

    scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +
    +

    +In this exercise we want you to to compute the MSE for the training +data and the test data as function of the complexity of a polynomial, +that is the degree of a given polynomial. We want you also to compute the \( R2 \) score as function of the complexity of the model for both training data and test data. You should also run the calculation with and without scaling. + +

    +One of +the aims is to reproduce Figure 2.11 of Hastie et al. + +

    +Our data is defined by \( x\in [-3,3] \) with a total of for example \( 100 \) data points. +

    + + +

    np.random.seed()
    +n = 100
    +maxdegree = 14
    +# Make data set.
    +x = np.linspace(-3, 3, n).reshape(-1, 1)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape)
    +
    +

    +where \( y \) is the function we want to fit with a given polynomial. + +

    +a) +Write a first code which sets up a design matrix \( X \) defined by a fifth-order polynomial. Scale your data and split it in training and test data. + +

    +b) +Perform an ordinary least squares and compute the means squared error and the \( R2 \) factor for the training data and the test data, with and without scaling. + +

    + +Solution. +This requires a simple extension to the above code where you simply add a statement calling the \( R2 \) function included in the same code. + + +

    +c) +Add now a model which allows you to make polynomials up to degree \( 15 \). Perform a standard OLS fitting of the training data and compute the MSE and \( R2 \) for the training and test data and plot both test and training data MSE and \( R2 \) as functions of the polynomial degree. Compare what you see with Figure 2.11 of Hastie et al. Comment your results. For which polynomial degree do you find an optimal MSE (smallest value)? + +

    + +Solution. +Here you simply need to change the degree of the polynomial in the above code to \( n=15 \). + + +

    + + diff --git a/doc/pub/week34/ipynb/ipynb-week34-src.tar.gz b/doc/pub/week34/ipynb/ipynb-week34-src.tar.gz index b80b652b6..f2a20ab0c 100644 Binary files a/doc/pub/week34/ipynb/ipynb-week34-src.tar.gz and b/doc/pub/week34/ipynb/ipynb-week34-src.tar.gz differ diff --git a/doc/pub/week34/ipynb/week34.ipynb b/doc/pub/week34/ipynb/week34.ipynb index 84c313b42..743009923 100644 --- a/doc/pub/week34/ipynb/week34.ipynb +++ b/doc/pub/week34/ipynb/week34.ipynb @@ -2471,6 +2471,10 @@ "Now it is time to dive more into the details of various methods. We will start with linear regression and try to take a deeper look at what it entails.\n", "\n", "\n", + "## Exercises for week 36\n", + "Here are three possible exercises for week 36 and the lab sessions of Wednesday September 1..\n", + "\n", + "\n", "\n", "\n", "\n", @@ -2534,7 +2538,7 @@ "analysis environment, available for free and under a commercial\n", "license.\n", "\n", - "We recommend using **Anaconda**.\n", + "We recommend using **Anaconda** if you are not too familiar with setting paths in a terminal environment.\n", "\n", "\n", "\n", @@ -2566,7 +2570,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "1. Write your own code (following the examples under the [regression slides](https://compphysics.github.io/MachineLearningECT/doc/pub/Day1/html/Day1-bs.html)) for computing the parametrization of the data set fitting a second-order polynomial. \n", + "1. Write your own code (following the examples under the [regression notes](https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter1.html)) for computing the parametrization of the data set fitting a second-order polynomial. \n", "\n", "2. Use thereafter **scikit-learn** (see again the examples in the regression slides) and compare with your own code. \n", "\n", @@ -2684,6 +2688,149 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "## Exercise 3: Normalizing our data\n", + "\n", + "A much used approach before starting to train the data is to preprocess our\n", + "data. Normally the data may need a rescaling and/or may be sensitive\n", + "to extreme values. Scaling the data renders our inputs much more\n", + "suitable for the algorithms we want to employ.\n", + "\n", + "**Scikit-Learn** has several functions which allow us to rescale the\n", + "data, normally resulting in much better results in terms of various\n", + "accuracy scores. The **StandardScaler** function in **Scikit-Learn**\n", + "ensures that for each feature/predictor we study the mean value is\n", + "zero and the variance is one (every column in the design/feature\n", + "matrix). This scaling has the drawback that it does not ensure that\n", + "we have a particular maximum or minimum in our data set. Another\n", + "function included in **Scikit-Learn** is the **MinMaxScaler** which\n", + "ensures that all features are exactly between $0$ and $1$. The\n", + "\n", + "\n", + "The **Normalizer** scales each data\n", + "point such that the feature vector has a euclidean length of one. In other words, it\n", + "projects a data point on the circle (or sphere in the case of higher dimensions) with a\n", + "radius of 1. This means every data point is scaled by a different number (by the\n", + "inverse of it’s length).\n", + "This normalization is often used when only the direction (or angle) of the data matters,\n", + "not the length of the feature vector.\n", + "\n", + "The **RobustScaler** works similarly to the StandardScaler in that it\n", + "ensures statistical properties for each feature that guarantee that\n", + "they are on the same scale. However, the RobustScaler uses the median\n", + "and quartiles, instead of mean and variance. This makes the\n", + "RobustScaler ignore data points that are very different from the rest\n", + "(like measurement errors). These odd data points are also called\n", + "outliers, and might often lead to trouble for other scaling\n", + "techniques.\n", + "\n", + "\n", + "It also common to split the data in a **training** set and a **testing** set. A typical split is to use $80\\%$ of the data for training and the rest\n", + "for testing. This can be done as follows with our design matrix $\\boldsymbol{X}$ and data $\\boldsymbol{y}$ (remember to import **scikit-learn**)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "# split in training and test data\n", + "X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Then we can use the standard scaler to scale our data as" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "scaler = StandardScaler()\n", + "scaler.fit(X_train)\n", + "X_train_scaled = scaler.transform(X_train)\n", + "X_test_scaled = scaler.transform(X_test)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In this exercise we want you to to compute the MSE for the training\n", + "data and the test data as function of the complexity of a polynomial,\n", + "that is the degree of a given polynomial. We want you also to compute the $R2$ score as function of the complexity of the model for both training data and test data. You should also run the calculation with and without scaling. \n", + "\n", + "One of \n", + "the aims is to reproduce Figure 2.11 of [Hastie et al](https://github.com/CompPhysics/MLErasmus/blob/master/doc/Textbooks/elementsstat.pdf).\n", + "\n", + "\n", + "\n", + "Our data is defined by $x\\in [-3,3]$ with a total of for example $100$ data points." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "np.random.seed()\n", + "n = 100\n", + "maxdegree = 14\n", + "# Make data set.\n", + "x = np.linspace(-3, 3, n).reshape(-1, 1)\n", + "y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $y$ is the function we want to fit with a given polynomial.\n", + "\n", + "\n", + "**a)**\n", + "Write a first code which sets up a design matrix $X$ defined by a fifth-order polynomial. Scale your data and split it in training and test data.\n", + "\n", + "**b)**\n", + "Perform an ordinary least squares and compute the means squared error and the $R2$ factor for the training data and the test data, with and without scaling.\n", + "\n", + "\n", + "\n", + "**Solution.**\n", + "This requires a simple extension to the above code where you simply add a statement calling the $R2$ function included in the same code.\n", + "\n", + "\n", + "**c)**\n", + "Add now a model which allows you to make polynomials up to degree $15$. Perform a standard OLS fitting of the training data and compute the MSE and $R2$ for the training and test data and plot both test and training data MSE and $R2$ as functions of the polynomial degree. Compare what you see with Figure 2.11 of Hastie et al. Comment your results. For which polynomial degree do you find an optimal MSE (smallest value)?\n", + "\n", + "\n", + "\n", + "**Solution.**\n", + "Here you simply need to change the degree of the polynomial in the above code to $n=15$.\n", "\n", "\n", "" diff --git a/doc/src/week34/week34.do.txt b/doc/src/week34/week34.do.txt index 2e4233ac1..7b789a744 100644 --- a/doc/src/week34/week34.do.txt +++ b/doc/src/week34/week34.do.txt @@ -1690,6 +1690,10 @@ Now it is time to dive more into the details of various methods. We will start w !split +===== Exercises for week 36 ===== +Here are three possible exercises for week 36 and the lab sessions of Wednesday September 1.. + + ===== Exercise: Setting up various Python environments ===== The first exercise here is of a mere technical art. We want you to have @@ -1748,7 +1752,9 @@ distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license. -We recommend using _Anaconda_. +We recommend using _Anaconda_ if you are not too familiar with setting paths in a terminal environment. + + ===== Exercise: making your own data and exploring scikit-learn ===== @@ -1761,7 +1767,7 @@ x = np.random.rand(100,1) y = 2.0+5*x*x+0.1*np.random.randn(100,1) !ec -o Write your own code (following the examples under the "regression slides":"https://compphysics.github.io/MachineLearningECT/doc/pub/Day1/html/Day1-bs.html") for computing the parametrization of the data set fitting a second-order polynomial. +o Write your own code (following the examples under the "regression notes":"https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter1.html") for computing the parametrization of the data set fitting a second-order polynomial. o Use thereafter _scikit-learn_ (see again the examples in the regression slides) and compare with your own code. o Using scikit-learn, compute also the mean square error, a risk metric corresponding to the expected value of the squared (quadratic) error defined as !bt @@ -1832,3 +1838,93 @@ print(MSE(y_test,ypredict)) !esol + +===== Exercise: Normalizing our data ===== + + +A much used approach before starting to train the data is to preprocess our +data. Normally the data may need a rescaling and/or may be sensitive +to extreme values. Scaling the data renders our inputs much more +suitable for the algorithms we want to employ. + +_Scikit-Learn_ has several functions which allow us to rescale the +data, normally resulting in much better results in terms of various +accuracy scores. The _StandardScaler_ function in _Scikit-Learn_ +ensures that for each feature/predictor we study the mean value is +zero and the variance is one (every column in the design/feature +matrix). This scaling has the drawback that it does not ensure that +we have a particular maximum or minimum in our data set. Another +function included in _Scikit-Learn_ is the _MinMaxScaler_ which +ensures that all features are exactly between $0$ and $1$. The + + +The _Normalizer_ scales each data +point such that the feature vector has a euclidean length of one. In other words, it +projects a data point on the circle (or sphere in the case of higher dimensions) with a +radius of 1. This means every data point is scaled by a different number (by the +inverse of it’s length). +This normalization is often used when only the direction (or angle) of the data matters, +not the length of the feature vector. + +The _RobustScaler_ works similarly to the StandardScaler in that it +ensures statistical properties for each feature that guarantee that +they are on the same scale. However, the RobustScaler uses the median +and quartiles, instead of mean and variance. This makes the +RobustScaler ignore data points that are very different from the rest +(like measurement errors). These odd data points are also called +outliers, and might often lead to trouble for other scaling +techniques. + + +It also common to split the data in a _training_ set and a _testing_ set. A typical split is to use $80\%$ of the data for training and the rest +for testing. This can be done as follows with our design matrix $\bm{X}$ and data $\bm{y}$ (remember to import _scikit-learn_) +!bc pycod +# split in training and test data +X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.2) +!ec +Then we can use the standard scaler to scale our data as +!bc pycod +scaler = StandardScaler() +scaler.fit(X_train) +X_train_scaled = scaler.transform(X_train) +X_test_scaled = scaler.transform(X_test) +!ec + + +In this exercise we want you to to compute the MSE for the training +data and the test data as function of the complexity of a polynomial, +that is the degree of a given polynomial. We want you also to compute the $R2$ score as function of the complexity of the model for both training data and test data. You should also run the calculation with and without scaling. + +One of +the aims is to reproduce Figure 2.11 of "Hastie et al":"https://github.com/CompPhysics/MLErasmus/blob/master/doc/Textbooks/elementsstat.pdf". + + + +Our data is defined by $x\in [-3,3]$ with a total of for example $100$ data points. +!bc pycod +np.random.seed() +n = 100 +maxdegree = 14 +# Make data set. +x = np.linspace(-3, 3, n).reshape(-1, 1) +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape) +!ec +where $y$ is the function we want to fit with a given polynomial. +!bsubex +Write a first code which sets up a design matrix $X$ defined by a fifth-order polynomial. Scale your data and split it in training and test data. +!esubex + +!bsubex +Perform an ordinary least squares and compute the means squared error and the $R2$ factor for the training data and the test data, with and without scaling. +!bsol +This requires a simple extension to the above code where you simply add a statement calling the $R2$ function included in the same code. +!esol +!esubex + +!bsubex +Add now a model which allows you to make polynomials up to degree $15$. Perform a standard OLS fitting of the training data and compute the MSE and $R2$ for the training and test data and plot both test and training data MSE and $R2$ as functions of the polynomial degree. Compare what you see with Figure 2.11 of Hastie et al. Comment your results. For which polynomial degree do you find an optimal MSE (smallest value)? +!bsol +Here you simply need to change the degree of the polynomial in the above code to $n=15$. +!esol +!esubex +