knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "90%", fig.align = "center" ) library(ggplot2) theme_set(theme_minimal(base_size = 5) + theme(legend.position = "bottom")) if(require(showtext)){ sysfonts::font_add_google("IBM Plex Sans", "plex") showtext::showtext_auto() }
The {klassets}
package is a collection of functions to simulate data sets to:
knitr::include_graphics("man/figures/animation_quasi_anscombre.gif")
library(klassets) set.seed(123) df <- sim_quasianscombe_set_1(beta0 = 3, beta1 = 0.5) plot(df) + ggplot2::labs(subtitle = "Very similar to the given parameters (3 and 0.5)")
library(patchwork) df2 <- sim_quasianscombe_set_2(df, fun = sin) df6 <- sim_quasianscombe_set_6(df, groups = 2, b1_factor = -1) plot(df2) + plot(df6)
df <- sim_response_xy(relationship = function(x, y) sin(x*pi) > sin(y*pi)) df plot(df)
You can fit different models and see how the predictions are made.
plot(fit_logistic_regression(df, order = 4)) + plot(fit_classification_tree(df)) + plot(fit_classification_random_forest(df)) + plot(fit_knn(df)) + plot_layout(guides = "collect")
Another example of what can be done with {klassets}
.
knitr::include_graphics("man/figures/animation_kmeans_iterations.gif")
You can check:
vignette("Quasi-Anscombe-data-sets")
to know more about sim_quasianscombe_set*
functions family.vignette("Binary-classification")
/vignette("Regression")
to see classifiers/regression models/methods.vignette("Clustering")
to see clustering functions.vignette("MNIST")
to work with this data set to compare models and check
some variable importance metrics.You can install the development version of klassets from GitHub with:
# install.packages("remotes") remotes::install_github("jbkunst/klassets")
Why the name Klassets? Just a weird merge for Class/Klass and sets.
Some inspiration and similar ideas:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.