Professional Documents
Culture Documents
FDS Sem VI Practical Slip 3 Solution
FDS Sem VI Practical Slip 3 Solution
import pandas as pd
df_User = pd.DataFrame(User)
y = df_User[['Purchased']]
log_reg = LogisticRegression()
log_reg.fit(X_train, y_train)
# Predict whether a person will buy a car or not
predictions = log_reg.predict(X_test)
# Print the predictions
print("Predictions:", predictions)