> For the complete documentation index, see [llms.txt](https://slmetrics-docs.gitbook.io/v1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://slmetrics-docs.gitbook.io/v1/readme.md).

# Introduction

[{SLmetrics}](https://github.com/serkor1/SLmetrics) is an implementation of 40+ scoring metrics for supervised and unsupervised machine learning and statistical learning models.

## Benchmarks

{% code title="Benchmark" overflow="wrap" lineNumbers="true" %}

```r
## seed
set.seed(1903)

## generate
## values
actual    <- rnorm(n = 1e8)
predicted <- actual + rnorm(n = 1e8)

## benchmark
## RMSE
bench::mark(
  `{SLmetrics}` = SLmetrics::rmse(actual, predicted),
  `{yardstick}` = yardstick::rmse_vec(actual, predicted),
  `{MLmetrics}` = MLmetrics::RMSE(predicted, actual),
  `{base}`      = sqrt(as.numeric(crossprod(actual - predicted))/length(actual))
)
#> Warning: Some expressions had a GC in every iteration; so filtering is
#> disabled.
#> # A tibble: 4 × 6
#>   expression       min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr>  <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1 {SLmetrics}  44.36ms  45.93ms    21.8      5.95MB    0    
#> 2 {yardstick}    3.98s    3.98s     0.251     4.1GB    0.754
#> 3 {MLmetrics} 669.96ms 669.96ms     1.49      763MB    0    
#> 4 {base}      483.24ms 562.09ms     1.78   762.94MB    0.890
```

{% endcode %}

## Install CRAN version

{% code title="CRAN version" overflow="wrap" lineNumbers="true" %}

```r
pak::pak(
    pkg = "SLmetrics",
    ask = FALSE
    )
```

{% endcode %}

## Install development version

{% stepper %}
{% step %}

#### Clone repository

{% code title="Clone Repository" overflow="wrap" lineNumbers="true" %}

```console
git clone --recurse-submodules https://github.com/serkor1/SLmetrics.git
```

{% endcode %}
{% endstep %}

{% step %}

#### Install with {pak}

{% code title="Install with {pak}" overflow="wrap" lineNumbers="true" %}

```r
pak::pak(
    pkg = ".",
    ask = FALSE
)
```

{% endcode %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://slmetrics-docs.gitbook.io/v1/readme.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
