Skip to content
Open
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
10 changes: 5 additions & 5 deletions src/folds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ validation subsets respectively. Each validation subset will have
either `size` or `size+1` observations assigned to it. The
following code snippet generates the index-vectors for `size = 2`.

```julia
```julia-repl
julia> train_idx, val_idx = leavepout(10, 2);
```

Expand All @@ -133,17 +133,17 @@ reproduces the full range `1:n`. Note that there is no random
assignment of observations to subsets, which means that adjacent
observations are likely to be part of the same validation subset.

```julia
```julia-repl
julia> train_idx
5-element Array{Array{Int64,1},1}:
5-element Vector{Vector{Int64}}:
[3,4,5,6,7,8,9,10]
[1,2,5,6,7,8,9,10]
[1,2,3,4,7,8,9,10]
[1,2,3,4,5,6,9,10]
[1,2,3,4,5,6,7,8]

julia> val_idx
5-element Array{UnitRange{Int64},1}:
5-element Vector{UnitRange{Int64}}:
1:2
3:4
5:6
Expand Down Expand Up @@ -186,4 +186,4 @@ function leavepout(data, p::Integer)
kfolds(data, k)
end

leavepout(data; p::Integer=1) = leavepout(data, p)
leavepout(data; p::Integer=1) = leavepout(data, p)
Loading