In the logistic regression, we deal with binary class i.e., two classes in the output columns. However, in the real world, we get various types of data and sometimes have more than two classes in the output column. In that case, we can use soft-max regression is a multinomial logistic regression or multi-class classification algorithm. For logistic regression, we can say, it is a form of soft-max regression.
Some of the learners may think that we are doing a classification problem, but we are using regression in the algorithm name. As the logistic base computation is linear only, the researcher just added the function to their linear output for classification.
The soft-max function creates the probability distribution for all classes that output sums up to 1. For example, If we have 4 classes in the output column, the probabilities of these classes can be [0.23, 0.45, 0.12, 0.20 ]. It means the class that has the highest probability will likely be the prediction based on the input.
It is very important to see the data first, observe it, and find the input and target columns or features. The next thing is to check, if there is an output column, then it will be a regression or classification else cluster-based approach if the output column is not available.
After observing all these things, the next step is to understand the data features fully. After reading about the features,, the researchers can easily interpret the important ones that can help in feature engineering transformation.
Topics to be covered:
- Soft-max regression model without using any transformation
- Soft-max regression model using log transformation for skew distribution columns.
- Soft-max regression model using feature scaling.
The next part is to do a visualization of the data.
Soft-max regression example with python:
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt