@@ -529,7 +529,7 @@ err_missing_model(model) = ErrorException(
529
529
)
530
530
531
531
"""
532
- last_model(mach::Machine)
532
+ last_model(mach::Machine)
533
533
534
534
Return the last model used to train the machine `mach`. This is a bona fide model, even if
535
535
`mach.model` is a symbol.
@@ -572,31 +572,31 @@ the true model given by `getproperty(composite, model)`. See also [`machine`](@r
572
572
For the action to be a no-operation, either `mach.frozen == true` or
573
573
or none of the following apply:
574
574
575
- - (i) `mach` has never been trained (`mach.state == 0`).
575
+ 1. `mach` has never been trained (`mach.state == 0`).
576
576
577
- - (ii) `force == true`.
577
+ 2. `force == true`.
578
578
579
- - (iii) The `state` of some other machine on which `mach` depends has
580
- changed since the last time `mach` was trained (ie, the last time
581
- `mach.state` was last incremented).
579
+ 3. The `state` of some other machine on which `mach` depends has
580
+ changed since the last time `mach` was trained (ie, the last time
581
+ `mach.state` was last incremented).
582
582
583
- - (iv) The specified `rows` have changed since the last retraining and
584
- `mach.model` does not have `Static` type.
583
+ 4. The specified `rows` have changed since the last retraining and
584
+ `mach.model` does not have `Static` type.
585
585
586
- - (v) `mach.model` is a model and different from the last model used for training, but has
587
- the same type.
586
+ 5. `mach.model` is a model and different from the last model used for training, but has
587
+ the same type.
588
588
589
- - (vi) `mach.model` is a model but has a type different from the last model used for
590
- training.
589
+ 6. `mach.model` is a model but has a type different from the last model used for
590
+ training.
591
591
592
- - (vii) `mach.model` is a symbol and `(composite, mach.model)` is different from the last
593
- model used for training, but has the same type.
592
+ 7. `mach.model` is a symbol and `(composite, mach.model)` is different from the last
593
+ model used for training, but has the same type.
594
594
595
- - (viii) `mach.model` is a symbol and `(composite, mach.model)` has a different type from
596
- the last model used for training.
595
+ 8. `mach.model` is a symbol and `(composite, mach.model)` has a different type from
596
+ the last model used for training.
597
597
598
- In any of the cases (i ) - (iv ), (vi ), or (viii ), `mach` is trained ab initio. If (v) or
599
- (vii ) is true, then a training update is applied.
598
+ In any of the cases (1 ) - (4 ), (6 ), or (8 ), `mach` is trained ab initio.
599
+ If (5) or (7 ) is true, then a training update is applied.
600
600
601
601
To freeze or unfreeze `mach`, use `freeze!(mach)` or `thaw!(mach)`.
602
602
@@ -658,7 +658,7 @@ function fit_only!(
658
658
rows === nothing && (rows = (:))
659
659
rows_is_new = ! isdefined (mach, :old_rows ) || rows != mach. old_rows
660
660
661
- condition_iv = rows_is_new && ! (mach. model isa Static)
661
+ condition_4 = rows_is_new && ! (mach. model isa Static)
662
662
663
663
upstream_has_changed = mach. old_upstream_state != upstream_state
664
664
@@ -672,16 +672,16 @@ function fit_only!(
672
672
673
673
# build or update cached `resampled_data` if necessary (`mach.data` is already defined
674
674
# above if needed here):
675
- if cache_data && (! data_is_valid || condition_iv )
675
+ if cache_data && (! data_is_valid || condition_4 )
676
676
mach. resampled_data = selectrows (model, rows, mach. data... )
677
677
end
678
678
679
679
# `fit`, `update`, or return untouched:
680
- if mach. state == 0 || # condition (i )
681
- force == true || # condition (ii )
682
- upstream_has_changed || # condition (iii )
683
- condition_iv || # condition (iv )
684
- modeltype_changed # conditions (vi ) or (vii )
680
+ if mach. state == 0 || # condition (1 )
681
+ force == true || # condition (2 )
682
+ upstream_has_changed || # condition (3 )
683
+ condition_4 || # condition (4 )
684
+ modeltype_changed # conditions (6 ) or (7 )
685
685
686
686
isdefined (mach, :report ) || (mach. report = LittleDict {Symbol,Any} ())
687
687
@@ -709,7 +709,7 @@ function fit_only!(
709
709
rethrow ()
710
710
end
711
711
712
- elseif model != mach. old_model # condition (v )
712
+ elseif model != mach. old_model # condition (5 )
713
713
714
714
# update the model:
715
715
fitlog (mach, :update , verbosity)
@@ -1044,9 +1044,10 @@ To serialise using a different format, see [`serializable`](@ref).
1044
1044
Machines are deserialized using the `machine` constructor as shown in
1045
1045
the example below.
1046
1046
1047
- > The implementation of `save` for machines changed in MLJ 0.18
1048
- > (MLJBase 0.20). You can only restore a machine saved using older
1049
- > versions of MLJ using an older version.
1047
+ !!! note
1048
+ The implementation of `save` for machines changed in MLJ 0.18
1049
+ (MLJBase 0.20). You can only restore a machine saved using older
1050
+ versions of MLJ using an older version.
1050
1051
1051
1052
### Example
1052
1053
@@ -1073,8 +1074,7 @@ predict(predict_only_mach, X)
1073
1074
general purpose serialization formats, can allow for arbitrary code
1074
1075
execution during loading. This means it is possible for someone
1075
1076
to use a JLS file that looks like a serialized MLJ machine as a
1076
- [Trojan
1077
- horse](https://en.wikipedia.org/wiki/Trojan_horse_(computing)).
1077
+ [Trojan horse](https://en.wikipedia.org/wiki/Trojan_horse_(computing)).
1078
1078
1079
1079
See also [`serializable`](@ref), [`machine`](@ref).
1080
1080
0 commit comments