Logistic Regression Model for classification problem
Week 3 of the Machine Learning course, we learnt about Logistic Regression Model.
Classification problems can be binary or multi-class. A decision boundary that can be either linear or non-linear is used to classify the inputs of such problem. For the multi-class classification, we can use "1 versus all" method that choose one class and then lump others into a second class then apply binary logistic regression to each case until a minimum value is achieved.
Tip: Don't use linear regression for the classification problem as it may give hypothesis that exceed the range.
Instead, use Logistic Regression Model that uses sigmoid / logistic function that always produce hypothesis between 0 and 1.
The hypothesis produced by Logistic Regression Model is always in terms of probability of the inputs being in a specific class while the hypothesis produced by linear regression is based on an output value (e.g. price of housing property). Hence, Cost function in Logistic Regression Model is different from that of linear regression.
Note: The word 'features' refers to characteristics of the input that contributes to the output. Example: price of the housing property (i.e. output) is determined by the location, size, number of bedrooms etc (i.e. features).
When the input have too few features, it can lead to "under-fitting" issue that cause the hypothesis to have high bias. On the other hand, if the input have too many features, using a high degree polynomial can lead to accurate predictions on training data but cannot provide accurate predictions on new unseen data. This is known as the "over-fitting" issue that cause the hypothesis to have high variance.
Two ways to resolve the problem of "over-fitting":
- Reduce the number of redundant features
- Regularization
- This method aims to reduce the 'weights' of each feature so that it can decrease the cost of the machine learning algorithm
If the hypothesis is a function based on too many features, linear and logistic regression models would be too inefficient. In other words, these models would have difficulties in finding a good hypothesis. Therefore, Neural Network Model is preferred (Week 4).
Comments
Post a Comment