Somebody please spot me what's wrong. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Somebody please spot me what's wrong.

I got all the test cases correct except the 3 and 6 but since I'm not in the pro pack, couldn't see them and realise my mistake... Here's my code. import numpy as np from sklearn.linear_model import LinearRegression model=LinearRegression() n = int(input()) X = [] for i in range(n): X.append([float(x) for x in input().split()]) y = [int(x) for x in input().split()] datapoint = [float(x) for x in input().split()] model.fit(X,y) print(int(model.predict([datapoint])))

15th Sep 2021, 3:30 PM
Srijito Ghosh
Srijito Ghosh - avatar
2 Answers
+ 2
Thnx very much...
15th Sep 2021, 5:28 PM
Srijito Ghosh
Srijito Ghosh - avatar
+ 1
You should indicate which problem this is. But, this does look like Bob the Builder. Only thing that jumps out to me is that you're using LinearRegression as opposed to LogisticRegression. And even us pros don't get to see all the test cases.
15th Sep 2021, 4:21 PM
Josiah Mathieu
Josiah Mathieu - avatar