Releases: tidymodels/yardstick
yardstick 1.3.2
yardstick 1.3.1
yardstick 1.3.0
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 withroc_curve_survival()
. -
Time-Dependent ROC AUC estimation for right-censored data can now be
calculated withroc_auc_survival()
.
Improvements
-
demographic_parity()
,equalized_odds()
, andequal_opportunity()
are new metrics for measuring model fairness. Each is implemented with thenew_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 andna_rm = FALSE
. (#344)
yardstick 1.2.0
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 withmetric_tweak()
will no longer
produces an error, and will favor arguments set withmetric_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()
,
andcheck_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 oftruth
andestimate
input. (#337). -
metric_summarizer()
is being soft deprecated in favor of the more specific
newly addedclass_metric_summarizer()
,numeric_metric_summarizer()
,
prob_metric_summarizer()
, andcurve_metric_summarizer()
(#322). -
dots_to_estimate()
is being soft deprecated along with
metric_summarizer()
.dots_to_estimate()
is not needed with
prob_metric_summarizer()
, andcurve_metric_summarizer()
(#329).
yardstick 1.1.0
yardstick 1.0.0
-
All yardstick metrics now support case weights through the new
case_weights
argument. This also includes metric-adjacent functions likeroc_curve()
,
pr_curve()
,conf_mat()
, andmetric_set()
. -
The
options
argument ofroc_curve()
,roc_auc()
,roc_aunp()
,
roc_aunu()
, andmetrics()
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 tobase::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 whenbias = FALSE
. -
j_index()
now throws a more correct warning if0
is in the denominator
when computingsens()
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
-
New metric
poisson_log_loss()
was added (#146). -
sensitivity()
andspecificity()
now work correctly with the tune and
workflowsets packages (#232). -
roc_curve()
now throws a more informative error iftruth
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 ofdplyr::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
-
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 ametric_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 asNA
(#198). -
The
kap()
metric has a newweighting
argument to apply linear or
quadratic weightings before computing the kappa value (#2, #125, @jonthegeek). -
When
sens()
is undefined when computingppv()
,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 forconf_mat
now respect user-defined dimension
names added throughconf_mat(dnn = )
or from converting a table with
dimension names to aconf_mat
(#191). -
Added an
as_tibble()
method formetric_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
-
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 explicitevent_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 anNA
, however, ignoring
levels in this manner is more consistent with implementations in the
HandTill2001 and pROC packages (#123). -
roc_auc()
androc_curve()
now setdirection = "<"
when computing the
ROC curve usingpROC::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 theevent_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
-
roc_auc()
now warns when there are no events or controls in the providedtruth
column, and returnsNA
(@dpastling, #132). -
Adds
sensitivity()
andspecificity()
as aliases forsens()
andspec()
respectively, avoids conflict with other packages e.g.readr::spec()
. -
roc_aunu()
androc_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) androc_aunp()
using the a priori class distribution (#70).