So, in the previous lecture, you saw what a sigmoid function is and why it is a good choice for modelling the probability of a class. Now, in this section, you will learn how you can find the **best fit sigmoid curve**. In other words, you will learn how to find the combination of β0 and β1 which fits the data best.

So, by varying the values of β0 and β1, you get different sigmoid curves. Now, based on some function that you have to minimise or maximise, you will get the best fit sigmoid curve.

Before you move on to that, here’s the interactive app used by Prof. Dinesh in the video. You can use it and see for yourself how the curve changes when the values of β0 and β1 are changed.

## Figer banana

In the next video, you will learn how to find the best fit sigmoid curve by choosing appropriate values of β0 and β1.

So, the best fitting combination of β0 and β1 will be the one which maximises the product:

(1−P1)(1−P2)(1−P3)(1−P4)(1−P6)(P5)(P7)(P8)(P9)(P10)

This product is called the **likelihood function**. It is the product of:

[(1−Pi)(1−Pi)—— for all non-diabetics ——–] * [(Pi)(Pi) ——– for all diabetics ——-]

So, say that for the ten points in our example, the labels are a little different, somewhat like this:

Point no | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

Diabetes | no | no | no | yes | no | yes | no | yes | yes | yes |

In this case, the likelihood would be equal to (1−P1)(1−P2)(1−P3)(1−P5)(1−P7)(P4)(P6)(P8)(P9)(P10)