Linear Splines to Generate Decision Boundaries

Create two dimensional datasets with decision boundaries set by linear splines. An HTML widget enables users to draw the splines on a web page and generate a JSON file that can be used to generate datasets.


sillysplines

The goal of sillysplines is to give you a simple HTMLWidget that can draw silly little linear splines in an HTML widget and then download the coordinates to create datasets from.

Installation

You can install the development version of sillysplines from GitHub with:

pak::pak("janithwanni/sillysplines")

You can install the CRAN version by running

install.packages("pak")

Example

You start off by running sillysplines() from the package.

library(sillysplines)
sillysplines()

This should open up an HTML widget that shows a box containing an initial spline design. You can add points by clicking on intermediate areas, and you can drag points by clicking on the nodes.

Once done you can click Download boundary to get a JSON file containing the coordinates.

Then it’s a matter of using the create_data function to create a dataset of your size

create_data(coord_filepath="<yourfilenamehere.json>", n_samples = 1000)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("sillysplines")

1.0.1 by Janith Wanniarachchi, 3 months ago


https://janithwanni.github.io/sillysplines/, https://github.com/janithwanni/sillysplines


Report a bug at https://github.com/janithwanni/sillysplines/issues


Browse source code at https://github.com/cran/sillysplines


Authors: Janith Wanniarachchi [aut, cre, cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports htmlwidgets, jsonlite, withr

Suggests rlang, shiny, testthat


See at CRAN