v0.16.0
MLJBase v0.16.0
Compatiblity upgrades
Extend compatibility to include CategoricalArrays 0.9 and require MLJScientificTypes 0.4.1, with the following behaviour changes:
- (breaking)
coerce(v, OrderedFactor)
andcoerce(v, OrderedFactor)
will first convert non-missing elements of an arrayv
into strings unless the eltype ofv
is a subtype ofUnion{AbstractString, Char, Number, Missing}
; for example, ifv = [:x, :y]
andvnew = coerce(v, Multiclass)
, thenvnew[1] == "x"
istrue
butvnew[1] == :x
isfalse
. Otherwise the behaviour is unaltered.
Clean-up of measures
Resolve #450:
-
(enhancement) Thorough review of measure doc-strings, including addition of automatic doc-string generation to simplify new contributions (
@create_docs
macro) -
Add a new trait for measures called
human_name
(mainly for use in documentation); for example its value forL1EpsilonInsLoss
isl1 ϵ-insensitive loss
. There is a fallback that guesses a human name from the type name. -
(breaking) Redefine
name
trait on all measures to return string version of type name, eg, forL1EpsilonInsLoss
type (or its instances) the value is "L1EpsilonLoss". This is for consistency withname
on models. Type names have changed to make them maximally descriptive (eg,RMS
is nowRootMeanSquaredError
) but the old names are kept as aliases. -
(enhancement) Add a new trait for measures called
instances
(distinct fromBase.instances
and not exported) which lists string versions of built in instances, mostly aliases for the default instance. For example, the value onRecall
is["true_positive_rate", "truepositive_rate", "tpr", "sensitivity", "recall", "hit_rate"]
. These instances appear second on calls tomeasures()
so user to can easily lookup a short method to call in common use cases (see PR #459) -
(enhancement) Ensure every measure has a default keyword constructor, so, for example
FScore()
now works. -
(breaking)
FScore
areBrierScore
have been simplified to avoid unnecessary type parameters; this may break some constructors, likeFScore{1.0}()
. You should never need to use{}
to construct a measure instance. -
(enhancement) All types from LossFunctions.jl are exported and they now have default key-word constructors, just like the built-in measures, and their instances can be called the same way too. (In LossFunctions.jl the instances are not callable.)
-
Add
BierLoss
. It is just negative ofBrierScore
. -
(breaking) Dissallow keyword arguments in calls to
confmat
, which is now an instance of a measure type (confmat = ConfusionMatrix()
), rather than a function hacked to look like a measure. So, instead ofconfmat(yhat, y, perm=[2, 3, 1])
useConfusionMatrix(perm=[2, 3, 1])(yhat, y)
. What used to be calledConfusionMatrix
is nowConfusionMatrixObject
. The ordinary user will never need to construct one directly. -
(mildlly breaking) The field name
eps
inLogLoss=CrossEntropy
(for clamping) is renamed totol
for consistency with other measures and elsewhere in julia. HoweverCrossEntropy(eps=...)
still works.
Closed issues:
- name, aliases cleanup for measures (#450)
- specifying rev=false in confmat giving unexpected behaviour in multiclass case (#458)
Merged pull requests: