This repository contains a case-based reasoning model Shiny App, with a UI-interface. The model predicts the sentence-type (detention or non-detention) of a new lawsuit case. The model uses open data from the Cook County Government.
The repository is in two languages, so please select the preferred language.
A version of this app is also hosted via shinyapps.io and can be viewed at the following URL: https://sietske97.shinyapps.io/casebased-reasoning-application-english/
Run the app from Rstudio, without cloning this repository, by running the following code:
runGitHub("case-based-reasoning-application/english", "sietske97")
This file contains the code of the application. First, the three scripts are sourced in the R folder. The user interface is then defined under the ui section. The 'server' part contains the responsive code to generate the user interface.
The data folder contains two files:
data.csvis the dataset used to run the cbr model. It is the database in which similar cases are searched.
query.csvis an example file that a user can edit and upload via the application.
The R folder consists of three files. 01_libraries.R is a script that loads libraries
02_functions.R is a script with two user-defined functions that the model uses
03_defining_values.R is a script that defines some values that the app needs. This way there is no unnecessary code in the app itself.
Data used for uploading the application to the shinyapps.io server
The www folder contains additional data that the app needs, such as images, html files and a CSS format file. The .jpg and .png files are images that are loaded into the app. The workflow.html file shows the workflow of the targets, and the mycss.css contains additional formatting for the placement of the lab logo.
Contains the markdown documents for the blog about how to build a case-based reasoning model in R.