7,448 views
3 3 votes

The dataset of pass/fail in an exam for 5 students is given in the table below. If we use Logistic Regression as the classifier and assume the model suggested by the optimizer will become the following for Odds of passing a course:

$\log_e(Odds) = -64 + 2 \times hours$

1) How to calculate the loss of model for the student who studied 33 hours? 

2) What is the total loss of the model given in equation below? 

$Logloss = -\frac{1}{N} \sum_{i=1}^N(y_i\log_e(p_i) + (1 - y_i)\log_e(1 - p_i))$

50% Accept Rate Accepted 31 answers out of 62 questions

1 Answer

Best answer
2 2 votes

Answer#2: Total Loss of the model

first we have to find all the probability of the student passing the course

lets i is representing the sampling index of the student

P1:

Z=-64+(2*29)=-6

P=1/(1+e^6)=0.0024

P2:

Z=-64+(2*15)=-34

P=1/(1+e^34)=0 (THE VALUE IS SO SMALL)

P3: ALREADY KNOW = 0.88

P4:

Z=-64+(2*28)=-8

P=1/(1+e^8)=0.00033

P5:

Z=-64+(2*39)=14

P=1/(1+e^-14)=0.999

 

THE TOTAL LOSS OF THE MODEL IS CALCULATED BELOW, BY USING THE FORMULA

Log-loss= -(yi*ln(P1)+(1-yi)ln(1-P1))

LOG-LOSS 1= -2.4E-3

LOG-LOSS 2= 0

LOG-LOSS 3= - 0.128

LOG-LOSS 4= -8.0164

LOG-LOSS 5= -0.001

TOTAL LOSS OF THE MODEL= LOG-LOSS= - (1/5)(-2.4E-3+0- 0.128-8.0164-0.001) = 1.6296

 

Answer 1:the loss of model for the student who studied 33 hours

Step 1: we have to find the probability to passing the course

P=1/(1+e^-z)

where z= odd= -64+(2*33)=2

after putting the values... P=1/(1+e^-2)=0.88

 

Now, lets calculate the log-loss of the model for that particular student, has sample number 3 which is "i" the sampling index

 

Log-loss= (yi*ln(P1)+(1-yi)ln(1-P1))

Log-loss=[1*ln(0.88)+(1-1)ln(1-0.88)]

Answer#1: Log-loss= - 0.128 loss of model for the student

selected by

Related questions

3 3 votes
1 answers 1 answer
7.8k
7.8k views
tofighi asked Feb 3, 2020
7,790 views
How to solve this problem?https://i.imgur.com/8urywpf.jpgQ1) Complete the ? sectionsQ2) Accuracy of system if threshold = 0.5?Q3) Accuracy of system if threshold = 0.95?
2 2 votes
1 answers 1 answer
13.3k
13.3k views
tofighi asked Mar 18, 2019
13,275 views
The dataset of pass/fail in an exam for 5 students is given in the table below. If we use Logistic Regression as the classifier and assume the model suggested by the opti...
2 2 votes
2 2 answers
10.5k
10.5k views
tofighi asked Jun 5, 2019
10,484 views
The hypothesis (model) of Logistic Regression which is a binary classifier ( $y =\{0,1\} $) is given in the equation below:Hypothesis$S(z)=P(y=1 | x)=h_{\theta}(x)=\frac{...
3 3 votes
2 answers 2 answers
8.4k
8.4k views
tofighi asked Apr 4, 2019
8,402 views
The scatter plot of Iris Dataset is shown in the figure below. Assume Softmax Regression is used to classify Iris to Setosa, Versicolor, or Viriginica using just petal le...
3 3 votes
1 answers 1 answer
10.8k
10.8k views
tofighi asked Mar 21, 2019
10,785 views
The scatter plot of Iris Dataset is shown in the figure below. Assume Softmax Regression is used to classify Iris to Setosa, Versicolor, or Viriginica using just petal le...