Skip to content

Commit

Permalink
fd-update
Browse files Browse the repository at this point in the history
  • Loading branch information
tlienart committed Feb 20, 2020
1 parent 63729ca commit bb0b3f1
Show file tree
Hide file tree
Showing 191 changed files with 12,468 additions and 30 deletions.
3 changes: 3 additions & 0 deletions __site/assets/getting-started/ensembles-3/code/ex1.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file was generated, do not modify it. # hide
using MLJ, PyPlot
import Statistics
8 changes: 8 additions & 0 deletions __site/assets/getting-started/ensembles-3/code/ex2.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated, do not modify it. # hide
Xs = source()
ys = source(kind=:target)

atom = @load DecisionTreeRegressor
atom.n_subfeatures = 4 # to ensure diversity among trained atomic models

machines = (machine(atom, Xs, ys) for i in 1:100)
5 changes: 5 additions & 0 deletions __site/assets/getting-started/ensembles-3/code/ex3.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file was generated, do not modify it. # hide
Statistics.mean(v...) = mean(v)
Statistics.mean(v::AbstractVector{<:AbstractNode}) = node(mean, v...)

yhat = mean([predict(m, Xs) for m in machines]);
2 changes: 2 additions & 0 deletions __site/assets/getting-started/ensembles-3/code/ex4.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file was generated, do not modify it. # hide
one_hundred_models = @from_network OneHundredModels(atom=atom) <= yhat
2 changes: 2 additions & 0 deletions __site/assets/getting-started/ensembles-3/code/ex5.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file was generated, do not modify it. # hide
X, y = @load_boston;
18 changes: 18 additions & 0 deletions __site/assets/getting-started/ensembles-3/code/ex6.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file was generated, do not modify it. # hide
r = range(atom,
:min_samples_split,
lower=2,
upper=100, scale=:log)

mach = machine(atom, X, y)

curve = learning_curve!(mach,
range=r,
measure=mav,
resampling=CV(nfolds=9),
verbosity=0)

plot(curve.parameter_values, curve.measurements)
xlabel(curve.parameter_name)

savefig(joinpath(@OUTPUT, "e1.svg")) # hide
18 changes: 18 additions & 0 deletions __site/assets/getting-started/ensembles-3/code/ex7.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file was generated, do not modify it. # hide
r = range(one_hundred_models,
:(atom.min_samples_split),
lower=2,
upper=100, scale=:log)

mach = machine(one_hundred_models, X, y)

curve = learning_curve!(mach,
range=r,
measure=mav,
resampling=CV(nfolds=9),
verbosity=0)

plot(curve.parameter_values, curve.measurements)
xlabel(curve.parameter_name)

savefig(joinpath(@OUTPUT, "e2.svg")) # hide
2 changes: 2 additions & 0 deletions __site/assets/getting-started/ensembles-3/code/ex8.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file was generated, do not modify it. # hide
PyPlot.close_figs() # hide
Loading

0 comments on commit bb0b3f1

Please sign in to comment.