This Shiny application enables to predict wine cultivars based on input parameters using a pre-trained Random Forest model. The model has been trained on a dataset containing various chemical properties of wines.
The application comprises two main panels:
- Sidebar Panel: Allows users to input wine parameters for prediction.
- Main Panel:
- Displays status/output messages.
- Shows prediction results in a tabular format or a treemap visualization.
-
Input Parameters: On the sidebar, input the desired wine parameters:
- Alcohol
- Malic acid
- Ash
- Alcalinity of ash
- Magnesium
- Total phenols
- Flavnoids
- Non-Flavnoid phenols
- Proanthocyanins
- Color intensity
- Hue
- OD280/OD315 of diluted wines
- Proline
-
Getting Predictions:
- Click the "Submit" button to trigger the prediction based on the provided parameters.
- Alternatively, users can upload a dataset in CSV format using the "Upload Data" option and click the "Get Predictions" button to obtain predictions for the uploaded data.
-
Output:
- The output section will display the prediction status or inform you when the server is ready for calculations.
- Once the prediction is complete, the table will display the predicted wine cultivars based on the input parameters or the uploaded dataset.
- A treemap visualization will be provided for the predictions made from the uploaded CSV file.
The predictive model used in this application is a Random Forest classifier trained on a wine dataset. The model has been saved as wine_model.rds
.
app.R
: Contains the code for the Shiny application.wine.data.csv
: The original dataset used to train the predictive model.test_data.csv
: A dataset containing test observations for prediction.wine_model.rds
: Saved Random Forest model used for predictions.background_image.jpeg
: Background image used for the application.
- R libraries:
tidyverse
,shiny
,shinythemes
,data.table
,randomForest
,shinyWidgets
,plotly
.
- Install the required R libraries using:
install.packages('library_name')
for each library, or- By installing the
environment.yml
file if you're using Conda.
- Run the Shiny application using RStudio or execute the
app.R
script in your R environment. - Access the application through the web browser at the following address: Wine Cultivar Prediction App.