Search this site
Embedded Files
AIMD GPDS Courses
  • Home
  • Courses
  • Contact
AIMD GPDS Courses
  • Home
  • Courses
  • Contact
  • More
    • Home
    • Courses
    • Contact

日本語  ❯

Lesson 5    ❮    Lesson List    ❮    Top Page

5.1  Preprocessing with sklearn

5.2  Linear Regression

❯  5.3  Logistic Regression

5.4  Classification Methods

5.5  Clustering Methods

⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
EXPECTED COMPLETION TIME
❲▹❳  Video   10m 10s
☷  Interactive readings   5m

Applying logistic regression

Splitting the Data

First, we preprocessed the data by converting categorical columns into numerical using get_dummies. Then, we separate the data into train and test data. The reset_index is used to assure that all the index start from 0.

Making the model

Logistic regression is similar to linear regression, with the only difference being the y data, which should contain integer values indicating the class relative to the observation.

Predicting the Target Variable

In contrast to linear regression, logistic regression doesn't just output the resulting class but also estimates the probability of the observation's being part of all three classes. 

©2023. All rights reserved.  Samy Baladram,
Graduate Program in Data Science - GSIS - Tohoku University
Google Sites
Report abuse
Page details
Page updated
Google Sites
Report abuse