Exercise 1: Build UI for Candy Bar Prediction

Build a logistic regression model UI for candy bar prediction.

Overview

In this exercise, we’ll build a complete web interface to predict a candy bar using Streamlit. There are multiple attributes associated with candies to identify whether it is a bar or not. These attributes are listed in the candyData.csv file.

The dataset

The dataset contains the following attributes along with each candy name and its ranking.

  • chocolate
  • fruity
  • caramel
  • peanutalmondy
  • nougat
  • crispedricewafer
  • hard
  • bar
  • pluribus
  • sugarpercent
  • pricepercent
  • winpercent

Required libraries

The following libraries need to be imported into our Python program.

Get hands-on with 1400+ tech skills courses.