﻿1
00:00:00,300 --> 00:00:01,200
All right, my friends.

2
00:00:01,200 --> 00:00:02,400
Let's see if you

3
00:00:02,400 --> 00:00:06,400
managed to build and train on your own
this logistic regression model.

4
00:00:06,566 --> 00:00:11,133
And I will go right now
to the documentation to scikit learn API

5
00:00:11,366 --> 00:00:14,966
in order to show you how to indeed
find information on your own,

6
00:00:15,100 --> 00:00:18,600
which is here, how to build that
logistic regression model.

7
00:00:18,600 --> 00:00:18,933
All right.

8
00:00:18,933 --> 00:00:21,933
So let's do this.
Let's open a new tab here.

9
00:00:22,166 --> 00:00:26,966
And in the search bar
let's just type scikit learn perfect.

10
00:00:27,100 --> 00:00:28,333
Let's press enter.

11
00:00:28,333 --> 00:00:33,900
And let's go you know to the first link
which is the main page of scikit learn.

12
00:00:34,200 --> 00:00:37,466
Then remember it's good to go to API here.

13
00:00:37,466 --> 00:00:40,466
The other option was to directly type
here in the search bar

14
00:00:40,533 --> 00:00:43,500
scikit learn logistic regression
class okay.

15
00:00:43,500 --> 00:00:47,300
But I really want to show you again
the API because indeed it contains

16
00:00:47,300 --> 00:00:47,900
everything.

17
00:00:47,900 --> 00:00:50,900
You know, all the things you can do
with scikit learn.

18
00:00:51,066 --> 00:00:54,800
So now we're going to scroll down
to find classification

19
00:00:55,200 --> 00:00:57,966
which is in a module below

20
00:00:57,966 --> 00:01:00,800
called linear models.

21
00:01:00,800 --> 00:01:01,633
Why is that?

22
00:01:01,633 --> 00:01:05,433
That's because of course the logistic
regression model is a linear model.

23
00:01:05,433 --> 00:01:08,966
And we will clearly see that at the end
with the visualization.

24
00:01:08,966 --> 00:01:10,933
And you will clearly see, you know, how to

25
00:01:10,933 --> 00:01:14,633
make the difference between a linear model
and a non-linear model.

26
00:01:14,633 --> 00:01:16,766
So we'll come to that later.
But there you go.

27
00:01:16,766 --> 00:01:19,866
This is where you find,
you know, knowing that linear model

28
00:01:19,866 --> 00:01:23,900
module of the scikit learn library,
all the linear classifiers.

29
00:01:23,900 --> 00:01:27,733
And one of them is
of course the logistic regression.

30
00:01:27,733 --> 00:01:29,233
So we're going to click this.

31
00:01:29,233 --> 00:01:30,766
And there you go.

32
00:01:30,766 --> 00:01:35,266
Here you have the whole documentation
of the logistic regression class.

33
00:01:35,266 --> 00:01:38,266
You know this is the name of the class
that allows the built

34
00:01:38,433 --> 00:01:40,166
the logistic regression model.

35
00:01:40,166 --> 00:01:42,266
And so that's all you needed to get.

36
00:01:42,266 --> 00:01:45,400
And you could get exactly the same thing
by just typing here

37
00:01:45,400 --> 00:01:48,533
in the search bar scikit
learn logistic regression class.

38
00:01:48,533 --> 00:01:50,300
You know you will end up in the same page.

39
00:01:50,300 --> 00:01:56,400
So now what we will only take is you know
the name of the class plus the module.

40
00:01:56,400 --> 00:01:59,500
And if you want scikit learn
and then we will rewrite it

41
00:01:59,700 --> 00:02:03,666
the right way to import our class
and then create the object.

42
00:02:03,900 --> 00:02:04,200
All right.

43
00:02:04,200 --> 00:02:09,466
So let's just copy this and then remember
the syntax is to start with from.

44
00:02:09,600 --> 00:02:11,666
So from scikit learn.

45
00:02:11,666 --> 00:02:15,600
And then from the linear
model module of scikit learn.

46
00:02:16,000 --> 00:02:18,800
And from this linear model module

47
00:02:18,800 --> 00:02:22,633
you import that logistic regression class.

48
00:02:23,100 --> 00:02:23,433
All right.

49
00:02:23,433 --> 00:02:24,833
So that's the usual syntax

50
00:02:24,833 --> 00:02:29,533
we take from the linear model
module of the scikit learn library.

51
00:02:29,533 --> 00:02:32,533
We import the logistic regression class.

52
00:02:32,833 --> 00:02:38,066
And now now the next natural step
is to create an object of this logistic

53
00:02:38,066 --> 00:02:42,000
regression class, which will be exactly
the logistic regression model itself.

54
00:02:42,300 --> 00:02:46,100
And since now we are in classification
and no longer in regression,

55
00:02:46,300 --> 00:02:49,300
well we're going to call our model
classifier.

56
00:02:49,366 --> 00:02:52,000
All right. So let's do this classifier.

57
00:02:52,000 --> 00:02:56,066
And that's how we'll call all our other
classification models of this part three.

58
00:02:56,333 --> 00:02:57,333
So classifier.

59
00:02:57,333 --> 00:02:59,833
And then you know the next step
we have to call the class.

60
00:02:59,833 --> 00:03:03,166
That's
how we create an instance of a class.

61
00:03:03,400 --> 00:03:04,266
So there we go.

62
00:03:04,266 --> 00:03:06,766
And then we add some parenthesis.

63
00:03:06,766 --> 00:03:09,933
And now the question is
do we have to input any parameters.

64
00:03:10,200 --> 00:03:10,833
Well.

65
00:03:10,833 --> 00:03:14,000
So far we would just like to build
the logistic regression model.

66
00:03:14,000 --> 00:03:15,233
But then don't worry.

67
00:03:15,233 --> 00:03:18,866
In part ten
I will teach you how to tune your models,

68
00:03:19,033 --> 00:03:22,933
which consists of, you know, choosing
the optimal values of your parameters

69
00:03:23,100 --> 00:03:27,700
in order to take the best version
of a model, but this will come later.

70
00:03:27,700 --> 00:03:32,100
Important so far, let's just focus on
how to build and train the simple

71
00:03:32,100 --> 00:03:36,200
logistic regression model,
which will yet provide amazing results.

72
00:03:36,300 --> 00:03:38,266
All right, so no parameters here.

73
00:03:38,266 --> 00:03:43,500
However, we'll just, you know,
and to this random state parameter

74
00:03:44,166 --> 00:03:48,300
which will allow us to get the same
results displayed on our notebook.

75
00:03:48,300 --> 00:03:50,633
So this is just for teaching purposes.

76
00:03:50,633 --> 00:03:54,266
You don't have to do it on your own data
sets for your own problems.

77
00:03:54,733 --> 00:03:55,033
All right.

78
00:03:55,033 --> 00:03:58,533
So random state
and we'll set that equal to zero.
