Skip to content

Commit 53bc52c

Browse files
authored
Merge pull request #32 from roland-KA/pluto-tut02
minor changes to be in sync with Jupyter notebook
2 parents 97196da + a497cbb commit 53bc52c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

notebooks/02_models/notebook.pluto.jl

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,17 @@ md"## Step 2. Split data into input and target parts"
166166
# ╔═╡ bf7f99f5-7096-441f-879e-dc128f3db7b3
167167
md"""
168168
Here's how we split the data into target and input features, which
169-
is needed for MLJ supervised models. We randomize the data at the
169+
is needed for MLJ supervised models. We can randomize the data at the
170170
same time:
171171
"""
172172

173173
# ╔═╡ 933cc42f-6be5-4b9b-a367-9aa3c6cf34d0
174-
yIris, XIris = unpack(iris, ==(:class), name->true; rng=123)
174+
yIris, XIris = unpack(iris, ==(:class), rng=123)
175+
176+
# ╔═╡ 8ad6eede-d717-4779-b8b2-fbca000635df
177+
md"""
178+
This puts the `:class` column into a vector `yIris`, and all remaining columns into a table `XIris`.
179+
"""
175180

176181
# ╔═╡ f35ad4f4-2f4b-4a05-a9b5-48d93ef82b89
177182
scitype(yIris)
@@ -200,7 +205,7 @@ If you already have an idea about the name of the model, you could search by str
200205
"""
201206

202207
# ╔═╡ aa58b3e3-bdda-433a-9c3d-3b151b04c0c3
203-
some_models = models("LinearRegressor") # sic
208+
some_models = models("LinearRegressor")
204209

205210
# ╔═╡ d31909f8-f5f1-4773-8a29-32f11452654a
206211
md"Each entry contains metadata for a model whose defining code is not yet loaded:"
@@ -457,7 +462,7 @@ info(model).prediction_type
457462
md"""
458463
**Important**:
459464
- In MLJ, a model that can predict probabilities (and not just point values) will do so by default.
460-
- For most probabilistic predictors, the predicted object is a `Distributions.Distribution` object, supporting the `Distributions.jl` [API](https://juliastats.org/Distributions.jl/latest/extends/#Create-a-Distribution-1) for such objects. In particular, the methods `rand`, `pdf`, `logpdf`, `mode`, `median` and `mean` will apply, where appropriate.
465+
- For most probabilistic predictors, the predicted object is a `Distributions.Distribution` object (supporting the `Distributions.jl` [API](https://juliastats.org/Distributions.jl/latest/extends/#Create-a-Distribution-1)) or a `CategoricalDistributions.UnivariateFinite` object (the case here), which all support the follwing methods: `rand`, `pdf`, `logpdf`; and, where appropriate: `mode`, `median` and `mean`.
461466
"""
462467

463468
# ╔═╡ 9653dbb8-a168-4a07-8dba-241d9b744683
@@ -689,8 +694,7 @@ data = (a = [1, 2, 3, 4],
689694
# ╔═╡ a1c60d89-5d61-4a26-b61c-748aec38e674
690695
y5, X5, w = unpack(data,
691696
==(:a),
692-
name -> elscitype(Tables.getcolumn(data, name)) == Continuous,
693-
name -> true);
697+
name -> elscitype(Tables.getcolumn(data, name)) == Continuous);
694698

695699
# ╔═╡ b5b23e79-35ce-4857-9727-ed822e4fd85d
696700
md"...attempt to guess the evaluations of the following (uncomment to see the results):"
@@ -2258,6 +2262,7 @@ version = "0.9.1+5"
22582262
# ╟─992ca8fb-1a20-4664-abd3-cb77d7a79683
22592263
# ╟─bf7f99f5-7096-441f-879e-dc128f3db7b3
22602264
# ╠═933cc42f-6be5-4b9b-a367-9aa3c6cf34d0
2265+
# ╟─8ad6eede-d717-4779-b8b2-fbca000635df
22612266
# ╠═f35ad4f4-2f4b-4a05-a9b5-48d93ef82b89
22622267
# ╟─b081e89d-3ded-4061-bf32-94657e65284e
22632268
# ╠═325b5554-5521-48da-9afd-65a5b5facac9

0 commit comments

Comments
 (0)