From a0d883e78a3c7cd698db8ad91d69503b241d9500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Estrada?= Date: Thu, 20 Jun 2024 20:51:45 -0500 Subject: [PATCH 1/2] Add using Statistics to some files --- .../intro-to-ml/01. ML - Representing data in a computer.ipynb | 2 +- .../intro-to-ml/03. ML - Representing data with models.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/01. ML - Representing data in a computer.ipynb b/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/01. ML - Representing data in a computer.ipynb index 1bee500..e1bf185 100644 --- a/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/01. ML - Representing data in a computer.ipynb +++ b/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/01. ML - Representing data in a computer.ipynb @@ -159,7 +159,7 @@ "outputs": [], "cell_type": "code", "source": [ - "[ mean(float.(c.(img))) for c = [red,green,blue], img = [apple,banana] ]" + "using Statistics\n[ mean(float.(c.(img))) for c = [red,green,blue], img = [apple,banana] ]" ], "metadata": {}, "execution_count": null diff --git a/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/03. ML - Representing data with models.ipynb b/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/03. ML - Representing data with models.ipynb index 83d78fa..852d426 100644 --- a/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/03. ML - Representing data with models.ipynb +++ b/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/03. ML - Representing data with models.ipynb @@ -43,7 +43,7 @@ "outputs": [], "cell_type": "code", "source": [ - "apple_red_amount = mean(Float64.(red.(apple)))\nbanana_red_amount = mean(Float64.(red.(banana)));\n\n\"The average value of red in the apple is $apple_red_amount, \" *\n\"while the average value of red in the banana is $banana_red_amount.\"" + "using Statistics\napple_red_amount = mean(Float64.(red.(apple)))\nbanana_red_amount = mean(Float64.(red.(banana)));\n\n\"The average value of red in the apple is $apple_red_amount, \" *\n\"while the average value of red in the banana is $banana_red_amount.\"" ], "metadata": {}, "execution_count": null From 65cb09bb3d737f7f3718fefd76319f608addcf06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Estrada?= Date: Thu, 4 Jul 2024 11:13:45 -0500 Subject: [PATCH 2/2] add Statistics package to file 09 - issue #89 --- .../intro-to-ml/09. ML - What is learning.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/09. ML - What is learning.ipynb b/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/09. ML - What is learning.ipynb index 5e22343..2b85691 100644 --- a/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/09. ML - What is learning.ipynb +++ b/introductory-tutorials/broader-topics-and-ecosystem/intro-to-ml/09. ML - What is learning.ipynb @@ -18,7 +18,7 @@ "outputs": [], "cell_type": "code", "source": [ - "using Plots; gr()\nusing Images; using Interact\n\nσ(x,w,b) = 1 / (1 + exp(-w*x+b))\n\napple = load(\"data/10_100.jpg\")\nbanana = load(\"data/104_100.jpg\")\napple_green_amount = mean(Float64.(green.(apple)))\nbanana_green_amount = mean(Float64.(green.(banana)));\n\n@manipulate for w in -10:0.01:30, b in 0:0.1:30\n \n plot(x->σ(x,w,b), 0, 1, label=\"Model\", legend = :topleft, lw=3)\n scatter!([apple_green_amount], [0.0], label=\"Apple\")\n scatter!([banana_green_amount], [1.0], label=\"Banana\")\n \nend" + "using Plots; gr()\nusing Images; using Interact\nusing Statistics\n\nσ(x,w,b) = 1 / (1 + exp(-w*x+b))\n\napple = load(\"data/10_100.jpg\")\nbanana = load(\"data/104_100.jpg\")\napple_green_amount = mean(Float64.(green.(apple)))\nbanana_green_amount = mean(Float64.(green.(banana)));\n\n@manipulate for w in -10:0.01:30, b in 0:0.1:30\n \n plot(x->σ(x,w,b), 0, 1, label=\"Model\", legend = :topleft, lw=3)\n scatter!([apple_green_amount], [0.0], label=\"Apple\")\n scatter!([banana_green_amount], [1.0], label=\"Banana\")\n \nend" ], "metadata": {}, "execution_count": null