Skip to content

Add using Statistics to some files #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down