Skip to content

Commit

Permalink
📚 Added function introduction
Browse files Browse the repository at this point in the history
* The classification section has a primer of factors
* The regression section is empty...
  • Loading branch information
serkor1 committed Jan 16, 2025
1 parent de9e135 commit 835c1c5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
47 changes: 46 additions & 1 deletion docs/classification_functions.qmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
---
format:
html:
code-overflow: wrap
execute:
cache: true
knitr:
opts_chunk:
comment: "#>"
messages: true
warning: false
---

# Classification functions {.unnumbered}

In this section all classification evaluation metrics are listed.
In this section all available classification metrics and related documentation is described. Common for all classifcation functions is that they use the class `factor`.

## A primer on factors

Consider a classification problem with three classes: `A`, `B`, and `C`. The actual vector of `factor` values is defined as follows:

```{r}
## set seed
set.seed(1903)
## actual
factor(
x = sample(x = 1:3, size = 10, replace = TRUE),
levels = c(1, 2, 3),
labels = c("A", "B", "C")
)
```

Here, the values 1, 2, and 3 are mapped to `A`, `B`, and `C`, respectively. Now, suppose your model does not predict any `B`'s. The predicted vector of `factor` values would be defined as follows:

```{r}
## set seed
set.seed(1903)
## predicted
factor(
x = sample(x = c(1, 3), size = 10, replace = TRUE),
levels = c(1, 2, 3),
labels = c("A", "B", "C")
)
```

In both cases, $k = 3$, determined indirectly by the `levels` argument.
3 changes: 2 additions & 1 deletion docs/regression_functions.qmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Regression functions {.unnumbered}

In this section all regression evaluation metrics are listed.
In this section all available regression metrics and related documentation is described. Common for all regression functions is that they use the class `numeric`.

0 comments on commit 835c1c5

Please sign in to comment.