metric_functions {segmetric}R Documentation

Metric functions

Description

The sm_compute() computes a given metric (metric_id parameter) from segmentation objects. It compares the reference to the segmentation polygons using a metric.

A list with all supported metrics can be obtained by sm_list_metrics() (see Details for more information).

The sm_metric_subset() returns the subset used to compute the metrics in segmetric object.

Usage

sm_compute(m, metric_id, ...)

sm_metric_subset(m, metric_id = NULL)

Arguments

m

A segmetric object.

metric_id

A character vector with metrics id to be computed.

...

Any additional argument to compute a metric (see Details).

Details

Value

Return a numeric vector with computed metric.

References

A complete list of cited references is available in ?segmetric.

See Also

sm_list_metrics()

Examples

# load sample datasets
data("sample_ref_sf", package = "segmetric")
data("sample_seg_sf", package = "segmetric")

# create segmetric object
m <- sm_read(ref_sf = sample_ref_sf, seg_sf = sample_seg_sf)

# compute AFI metric and summarize it
sm_compute(m, "AFI") %>% summary()

# compute three metrics and summarize them
sm_compute(m, c("AFI", "OS1", "US2")) %>% summary()

# compute OS1, F_measure, and US2 metrics using pipe
m <- sm_compute(m, "OS1") %>%
  sm_compute("F_measure") %>%
  sm_compute("US2")

# summarize them
summary(m)


[Package segmetric version 0.3.0 Index]