Logistic Regression - Colab
Logistic Regression - Colab
df = pd.read_csv('logistic.csv')
df
age insurance
0 22 0
1 25 0
2 47 1
3 52 1
4 46 1
plt.scatter(df.age,df.insurance,marker='*',color='red')
<matplotlib.collections.PathCollection at 0x799f67280790>
x_train
age
0 22
1 25
3 52
2 47
len(x_test)
model.fit(x_train, y_train)
▾ LogisticRegression i ?
LogisticRegression()
x_test
age
4 46
model.predict(x_test)
array([1])
model.predict([[25]])
/usr/local/lib/python3.11/dist-packages/sklearn/utils/validation.py:2739: UserWa
warnings.warn(
array([0])