Classification vs Regression

Classification vs. Regression

  • Classification problem: predicting among two or more categories, also known as classes
    • Example1: Predict whether a patient has a liver disease or not
    • Example2: Predict whether the letter grade of a student (A,B,C,D or F)
  • Regression problem: predicting a continuous (in other words, a number) value
    • Example1: Predict housing prices
    • Example2: Predict a student’s score in this course’s quiz2
classfication vs. regression
classification_df = pd.read_csv("data/quiz2-grade-toy-classification.csv")
classification_df.head()
ml_experience class_attendance lab1 lab2 lab3 lab4 quiz1 quiz2
0 1 1 92 93 84 91 92 A+
1 1 0 94 90 80 83 91 not A+
2 0 0 78 85 83 80 80 not A+
3 0 1 91 94 92 91 89 A+
4 0 1 77 83 90 92 85 A+
regression_df = pd.read_csv("data/quiz2-grade-toy-regression.csv")
regression_df.head()
ml_experience class_attendance lab1 lab2 lab3 lab4 quiz1 quiz2
0 1 1 92 93 84 91 92 90
1 1 0 94 90 80 83 91 84
2 0 0 78 85 83 80 80 82
3 0 1 91 94 92 91 89 92
4 0 1 77 83 90 92 85 90

Let’s apply what we learned!