Skip to content

v0.16.0

Compare
Choose a tag to compare
@github-actions github-actions released this 27 Nov 04:43
· 1335 commits to master since this release
2597c5b

MLJBase v0.16.0

Diff since v0.15.7

Compatiblity upgrades

Extend compatibility to include CategoricalArrays 0.9 and require MLJScientificTypes 0.4.1, with the following behaviour changes:

  • (breaking) coerce(v, OrderedFactor) and coerce(v, OrderedFactor) will first convert non-missing elements of an array v into strings unless the eltype of v is a subtype of Union{AbstractString, Char, Number, Missing}; for example, if v = [:x, :y] and vnew = coerce(v, Multiclass), then vnew[1] == "x" is true but vnew[1] == :x is false. 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 for L1EpsilonInsLoss is l1 ϵ-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, for L1EpsilonInsLoss type (or its instances) the value is "L1EpsilonLoss". This is for consistency with name on models. Type names have changed to make them maximally descriptive (eg, RMS is now RootMeanSquaredError) but the old names are kept as aliases.

  • (enhancement) Add a new trait for measures called instances (distinct from Base.instances and not exported) which lists string versions of built in instances, mostly aliases for the default instance. For example, the value on Recall is ["true_positive_rate", "truepositive_rate", "tpr", "sensitivity", "recall", "hit_rate"]. These instances appear second on calls to measures() 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 are BrierScore have been simplified to avoid unnecessary type parameters; this may break some constructors, like FScore{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 of BrierScore.

  • (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 of confmat(yhat, y, perm=[2, 3, 1]) use ConfusionMatrix(perm=[2, 3, 1])(yhat, y). What used to be called ConfusionMatrix is now ConfusionMatrixObject. The ordinary user will never need to construct one directly.

  • (mildlly breaking) The field name eps in LogLoss=CrossEntropy (for clamping) is renamed to tol for consistency with other measures and elsewhere in julia. However CrossEntropy(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:

  • Cleanup the measures (aka loss functions and scores) (#459) (@ablaom)
  • Extend [compat] CategoricalArrays 0.9 and adjust to breaking changes (#460) (@ablaom)
  • For a 0.16.0 release (#461) (@ablaom)