Skip to content

Commit

Permalink
update internals.md for rows -> previous_rows change
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed Sep 22, 2019
1 parent 96f6b57 commit 8571735
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/src/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mutable struct Machine{M<Model}
cache
args::Tuple # e.g., (X, y) for supervised models
report
rows # remember last rows used
previous_rows # remember last rows used

function Machine{M}(model::M, args...) where M<:Model
machine = new{M}(model)
Expand Down Expand Up @@ -45,7 +45,7 @@ function fit!(machine::Machine; rows=nothing, force=false, verbosity=1)
rows = (:)
end

rows_have_changed = (!isdefined(mach, :rows) || rows != mach.rows)
rows_have_changed = (!isdefined(mach, :previous_rows) || rows != mach.previous_rows)

args = [MLJ.selectrows(arg, rows) for arg in mach.args]

Expand All @@ -58,7 +58,7 @@ function fit!(machine::Machine; rows=nothing, force=false, verbosity=1)
end

if rows_have_changed
mach.rows = deepcopy(rows)
mach.previous_rows = deepcopy(rows)
end

if report !== nothing
Expand Down

0 comments on commit 8571735

Please sign in to comment.