Purpose of fit method in sklearn module in python?

0 votes
I am new to machine learning. I am a bit confused about the function of fit module in scikit-learn.

can you tell me why it is used in sklearn?
Jul 5, 2019 in Python by Waseem
• 4,540 points

edited Jun 25 by MD 798 views

1 answer to this question.

0 votes
it basically trains your model using the dataset u provided.
answered May 13 by Mahesh
• 140 points
In which sense does it train?What difference does it make to our dataset can you explain vividly?

Hi@Ruchika,

Say you have one dataset as given below.

experience                 salary
 1                         10000
 2                         20000  
 3                         30000

When you fit these data into your model, it will take an experience from your dataset and internally it will find some parameters like bias and weights. Now if you give some new data to your model, say if someone has experience 2.5, how much salary he/she will get. That time your model automatically finds the salary using the bias and weights.

Related Questions In Python

0 votes
1 answer

What is the purpose of inner class in Python?

Advantages of inner class: Logical grouping of classes: ...READ MORE

answered Feb 7, 2019 in Python by SDeb
• 13,250 points
649 views
0 votes
1 answer

.join() method is used for what purpose in Python?

join() method is used to concatenate or ...READ MORE

answered May 14, 2019 in Python by Taj
• 1,060 points
151 views
0 votes
1 answer

What is the purpose of using lambda functions in Python?

The main purpose of anonymous functions come ...READ MORE

answered Jun 11, 2019 in Python by Nisa
• 1,090 points
141 views
0 votes
1 answer

What is the purpose of hash function in python?

The hash() method returns the hash value of an object if it ...READ MORE

answered Aug 2, 2019 in Python by Mohammad
• 3,210 points
99 views
0 votes
1 answer

What is the purpose of else part in python exception handling?

When an error occurs, or exception as ...READ MORE

answered Aug 22, 2019 in Python by Arvind
• 2,980 points
106 views
0 votes
1 answer

What is the purpose of ​#!/usr/bin/python​on the first line in the above code?

Hey, @Roshni, By specifying #!/usr/bin/python you specify exactly ...READ MORE

answered Jun 23 in Python by Gitika
• 34,050 points
28 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,220 views
0 votes
0 answers
0 votes
1 answer

How to compare expected and predicted values?

The predict() function returns a plain numpy ...READ MORE

answered Jul 13, 2019 in Python by Tina
223 views