Skip to content

Commit 2f344df

Browse files
authored
Example notebook: kernel ridge regression (#320)
Extended tutorial-style kernel ridge regression example that starts from linear regression, shows how to get to kernel ridge regression, and how to use KernelFunctions.jl kernels instead of manually adding feature vectors. Also changes the `preprocess` in literate.jl to filter out `##` lines to delimit code blocks in VSCode.
1 parent 10ad9ee commit 2f344df

File tree

4 files changed

+154
-294
lines changed

4 files changed

+154
-294
lines changed

docs/literate.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Pkg.activate(EXAMPLEPATH)
1313
Pkg.instantiate()
1414
using Literate: Literate
1515

16-
# Add link to nbviewer below the first heading of level 1
1716
function preprocess(content)
17+
# Add link to nbviewer below the first heading of level 1
1818
sub = SubstitutionString(
1919
"""
2020
#md # ```@meta
@@ -35,7 +35,12 @@ function preprocess(content)
3535
#
3636
""",
3737
)
38-
return replace(content, r"^# # [^\n]*"m => sub; count=1)
38+
content = replace(content, r"^# # [^\n]*"m => sub; count=1)
39+
40+
# remove VSCode `##` block delimiter lines
41+
content = replace(content, r"^##$."ms => "")
42+
43+
return content
3944
end
4045

4146
# Convert to markdown and notebook

0 commit comments

Comments
 (0)