Skip to content

Releases: tidymodels/yardstick

yardstick 1.3.1

21 Mar 22:44
Compare
Choose a tag to compare

Bug Fixes

  • Bug was fixed in roc_curve_survival() where wrong weights were used. (#495, @asb2111).

  • Output of roc_curve_survival() now returns columns in same order as roc_curve(). (#498)

yardstick 1.3.0

20 Jan 01:11
Compare
Choose a tag to compare

New Metrics

  • The Brier score for survival data was added with brier_survival().

  • The Integrated Brier score for survival data was added with brier_survival_integrated().

  • The Concordance index for survival data was added with concordance_survival().

  • Time-Dependent ROC curves estimation for right-censored data can now be
    calculated with roc_curve_survival().

  • Time-Dependent ROC AUC estimation for right-censored data can now be
    calculated with roc_auc_survival().

Improvements

  • demographic_parity(), equalized_odds(), and equal_opportunity() are new metrics for measuring model fairness. Each is implemented with the new_groupwise_metric() constructor, a general interface for defining group-aware metrics that allows for quickly and flexibly defining fairness metrics with the problem context in mind.

  • metric_set() can now be used with a combination of dynamic and static survival metrics.

  • Added a print method for metrics and metric sets (#435).

  • All warnings and errors have been updated to use the cli package for increased clarity and consistency. (#456, #457, #458)

  • brier_survival_integrated() now throws an error if input data only includes 1 evalution time point. (#460)

  • Clarifying documentation about how event_level always default to "first. (#432)

Bug Fixes

  • Metrics now throw more informative error if estimate argument is wrongly used. (#443)

Breaking Changes

  • Curve metrics now throw an informative error instead of returning NA when missing values are found and na_rm = FALSE. (#344)

yardstick 1.2.0

21 Apr 16:50
Compare
Choose a tag to compare

New Metrics

  • The Brier score for classification was added with brier_class() (#139).

Improvements

  • The global option, yardstick.event_first, has been hard deprecated in favor
    of using explicit argument, event_level. Setting this option will now
    produce an warning, but won't have any effect. (#173)

  • Removed start-up message about event_level argument.

  • yardstick metric functions now use a pure tidyselect interface for truth,
    estimate, and the ... of class probability metrics (#322).

  • Changed the default aspect ratio for PR curves to be 1.0.

  • Error messages now show what user-facing function was called (#348).

  • classification and probability metrics now fully support class_pred objects
    from {probably} package (#341).

Bug Fixes

  • Using metric_set() on a metric created with metric_tweak() will no longer
    produces an error, and will favor arguments set with metric_tweak() (#351).

  • Metric summarizers no longer error if column names in data conflict with
    argument names (#382).

  • conf_mat() no longer throw errors listed as internal (#327).

Developer

  • metric_vec_template() is being soft deprecated in favor of a more manual
    and flexible metric creation approach. yardstick_remove_missing() and
    yardstick_any_missing() have been added for treatment of missing values.
    check_class_metric(), check_numeric_metric(),
    and check_prob_metric() have been added to perform standardized input
    checking for classification, regression and class probability metrics
    respectively. These changes mean that it is the developer's responsibility
    to perform validation of truth and estimate input. (#337).

  • metric_summarizer() is being soft deprecated in favor of the more specific
    newly added class_metric_summarizer(), numeric_metric_summarizer(),
    prob_metric_summarizer(), and curve_metric_summarizer() (#322).

  • dots_to_estimate() is being soft deprecated along with
    metric_summarizer(). dots_to_estimate() is not needed with
    prob_metric_summarizer(), and curve_metric_summarizer() (#329).

yardstick 1.1.0

07 Sep 23:51
fad4471
Compare
Choose a tag to compare
  • Emil Hvitfeldt is now the maintainer (#315).

  • Improved on the chained error thrown by metric_set() when one of the metric
    computations fails (#313).

yardstick 1.0.0

06 Jun 20:37
d34ff72
Compare
Choose a tag to compare
  • All yardstick metrics now support case weights through the new case_weights
    argument. This also includes metric-adjacent functions like roc_curve(),
    pr_curve(), conf_mat(), and metric_set().

  • The options argument of roc_curve(), roc_auc(), roc_aunp(),
    roc_aunu(), and metrics() that was passed along to the pROC package is
    now deprecated and no longer has any affect. This is a result of changing to
    an ROC curve implementation that supports case weights, but does not support
    any of the previous options. If you need these options, we suggest wrapping
    pROC yourself in a custom metric (#296).

  • conf_mat() now ignores any inputs passed through ... and warns if you
    try to do such a thing. Previously, those were passed on to base::table(),
    but with the addition of case weight support, table() is no longer used
    (#295).

  • Fixed a small mistake in ccc() where the unbiased covariance wasn't being
    used when bias = FALSE.

  • j_index() now throws a more correct warning if 0 is in the denominator
    when computing sens() internally. Additionally, in the multiclass case it
    now removes the levels where this occurs from the multiclass weighted average
    computation, which is consistent with how other metrics were updated to handle
    this in #118 (#265).

  • Improved on some possible ambiguity in the documentation of the data
    argument for all metrics (#255).

  • purrr has been removed from Suggests.

  • The pROC package has been removed as a dependency (#300).

  • Moved the Custom Metrics vignette to tidymodels.org (#236).

yardstick 0.0.9

23 Nov 14:01
cee085c
Compare
Choose a tag to compare
  • New metric poisson_log_loss() was added (#146).

  • sensitivity() and specificity() now work correctly with the tune and
    workflowsets packages (#232).

  • roc_curve() now throws a more informative error if truth doesn't have any
    control or event observations.

  • dplyr 1.0.0 is now required. This allowed us to remove multiple usages of
    dplyr::do() in favor of dplyr::summarise(), which can now return packed
    data frame columns and multiple rows per group.

  • Removed internal hardcoding of "dplyr_error" to avoid issues with an
    upcoming dplyr 1.0.8 release (#244).

  • Updated test suite to testthat 3e (#243).

  • Internal upkeep has been done to move from rlang::warn(.subclass = ) to
    rlang::warn(class = ), since the .subclass argument has been deprecated
    (#225).

yardstick 0.0.8

29 Mar 12:14
0a02aee
Compare
Choose a tag to compare
  • New metric_tweak() for adjusting the default values of optional arguments in
    an existing yardstick metric. This is useful to quickly adjust the defaults
    of a metric that will be included in a metric_set(), especially if that
    metric set is going to be used for tuning with the tune package (#206, #182).

  • New classification_cost() metric for computing the cost of a poor class
    probability prediction using user-defined costs (#3).

  • New msd() for computing the mean signed deviation (also called mean
    signed difference, or mean signed error) (#183, @datenzauberai).

  • class_pred objects from the probably
    package are now supported, and are automatically converted to factors before
    computing any metric. Note that this means that any equivocal values are
    materialized as NA (#198).

  • The kap() metric has a new weighting argument to apply linear or
    quadratic weightings before computing the kappa value (#2, #125, @jonthegeek).

  • When sens() is undefined when computing ppv(), npv(), j_index(), or
    bal_accuracy(), a sensitivity warning is now correctly thrown, rather than
    a recall warning (#101).

  • The autoplot() method for gain curves now plots the curve line
    on top of the shaded polygon, resulting in a sharper look for the
    line itself (#192, @eddjberry).

  • The autoplot() methods for conf_mat now respect user-defined dimension
    names added through conf_mat(dnn = ) or from converting a table with
    dimension names to a conf_mat (#191).

  • Added an as_tibble() method for metric_set objects. Printing a
    metric_set now uses this to print out a tibble rather than a data frame
    (#186).

  • Re-licensed package from GPL-2 to MIT. See consent from copyright holders
    here
    (#204).

yardstick 0.0.7

16 Jul 15:59
94337df
Compare
Choose a tag to compare
  • The global option, yardstick.event_first, has been deprecated in favor of
    the new explicit argument, event_level. All metric functions that previously
    supported changing the "event" level have gained this new argument.
    The global option was a historical design decision that can be classified as
    a case of a hidden argument.
    Existing code that relied on this global option will continue to work in this
    version of yardstick, however you will now get a once-per-session warning
    that requests that you update to instead use the explicit event_level
    argument. The global option will be completely removed in a future version.
    To update, follow the guide below (#163).

    `options(yardstick.event_first = TRUE)`  -> `event_level = "first"` (the default)
    `options(yardstick.event_first = FALSE)` -> `event_level = "second"`
    
  • The roc_auc() Hand-Till multiclass estimator will now ignore levels in
    truth that occur zero times in the actual data. With other methods of
    multiclass averaging, this usually returns an NA, however, ignoring
    levels in this manner is more consistent with implementations in the
    HandTill2001 and pROC packages (#123).

  • roc_auc() and roc_curve() now set direction = "<" when computing the
    ROC curve using pROC::roc(). Results were being computed incorrectly with
    direction = "auto" when most probability values were predicting the wrong
    class (#123).

  • mn_log_loss() now respects the (deprecated) global option
    yardstick.event_first. However, you should instead change the relevant
    event level through the event_level argument.

  • metric_set() now strips the package name when auto-labeling functions
    (@rorynolan, #151).

  • There are three new helper functions for more easily creating custom
    metric functions: new_class_metric(), new_prob_metric(), and
    new_numeric_metric().

  • Rcpp has been removed as a direct dependency.

yardstick 0.0.6

03 Apr 13:25
f2fb22f
Compare
Choose a tag to compare
  • roc_auc() now warns when there are no events or controls in the provided truth column, and returns NA (@dpastling, #132).

  • Adds sensitivity() and specificity() as aliases for sens() and spec() respectively, avoids conflict with other packages e.g. readr::spec().

  • roc_aunu() and roc_aunp() are two new ROC AUC metrics for multiclass classifiers. These measure the AUC of each class against the rest, roc_aunu() using the uniform class distribution (#69) and roc_aunp() using the a priori class distribution (#70).

yardstick 0.0.5

31 Jan 19:32
ff12bae
Compare
Choose a tag to compare

Other improvements

  • The autoplot() heat map for confusion matrices now places the predicted values on the x axis and the truth values on the y axis to be more consistent with the confusion matrix print() method.

  • The autoplot() mosaic plot for confusion matrices had the x and y axis labels backwards. This has been corrected.