abjer / isds2020

Introduction to Social Data Science 2020 - a summer school course abjer.github.io/isds2020
58 stars 92 forks source link

Questions about ML #54

Open xfz809 opened 3 years ago

xfz809 commented 3 years ago

Hey,

We are stuck with the machine learning part and become more confused the more we work on it.

These are the biggest questions we have:

-which models can we use for classification? In the overview it says we should use the logistic one whereas in previous modules it was mentioned that we can use Perceptron, ADALINE (linear activation function), and sigmoid (logistic activation function)

-how can we train the algorithm so that the output of a prediction matches the definition of our classes? Our target is coded as 0 and 1. However, when we fit a Perceptron as suggested by Rashka and Mirjalili on page 82 the prediction is -1 and 1. Shall we just convert it so that -1=0? The problem is even worse for the logistic model where the predictions are integers.

-We follow the book 1-by-1 when using AdalineGD and AdalineSGD. Weirdly, on the training set the AdalineGD yields an accuracy of 0.634 and the AdalineSGD yields one of 0.3235. How can this be?

-It is not entirely clear for us which models we can use for regression and which for classification. Sometimes it seem like we simply convert the prediction from regression so that it fits the classification problem.

Any help would be highly appreciated!

abjer commented 3 years ago

Hi there. Have you seen the ML cookbook I linked to in the recent Absalon announcement? I have added videos. You should use either the Linear Regression or Logistic Regression with regularization for respectively regression and classification problems. You are welcome to compare with Adaline etc.

xfz809 commented 3 years ago

Thanks for your quick reply!

We would like to compare Adaline as a kind of baseline with logistic regression with L1 and L2 reg. respectively as the more sophisticated ones.

Do you have an idea about the above mentioned problem with AdalineGD and AdalineSGD?