add chapter 14

This commit is contained in:
Bogumił Kamiński
2022-03-14 00:12:33 +01:00
parent 34e80b2cba
commit b5e90546e6
5 changed files with 211 additions and 88 deletions

14
appB.jl
View File

@@ -256,3 +256,17 @@ end
train2 = owensboro2[owensboro2.train, :]
test2 = owensboro2[.!owensboro2.train, :]
test3, train3 = groupby(owensboro2, :train, sort=true)
# Code for exercise 14.1
@time mean(x -> x < 0, -10^6:10^6)
@time mean(x -> x < 0, -10^6:10^6)
@time mean(x -> x < 0, -10^6:10^6)
@time mean(<(0), -10^6:10^6)
@time mean(<(0), -10^6:10^6)
@time mean(<(0), -10^6:10^6)
lt0(x) = x < 0
@time mean(lt0, -10^6:10^6)
@time mean(lt0, -10^6:10^6)
@time mean(lt0, -10^6:10^6)