0
Logistic regression
It’s from the bob the builder project of the course, I couldn’t know what’s wrong with it, any help https://code.sololearn.com/ca191a10A47A/?ref=app
3 Respuestas
0
what is the error message you’re getting? We do not have the quiz input, and do not know what the expected output is.
0
from sklearn.linear_model import LogisticRegression
import pandas as pd
# Input number of samples
n = int(input())
# Read feature data
X = []
for _ in range(n):
X.append([float(x) for x in input().split()])
# Read target values
y = [int(x) for x in input().split()]
# Read a single data point (not used in scoring here)
datapoint = [float(x) for x in input().split()]
# Train logistic regression model
model = LogisticRegression()
model.fit(X, y)
# Predict (not used but shown here)
predictions = model.predict(X)
# Output the model's accuracy score
print(int(model.score(X, y)))
-------
Use the above code. Learn more from- https://www.statisticalaid.com/