Issue
For this question, I do not know why it says predict_proba() missing 1 required positional argument: 'X'
Can anyone please help me with this?
Here is my code:
df1 = pd.read_csv('new_customer_info.csv')
df1 = df1.drop(columns = ['person_home_ownership', 'loan_intent', 'loan_grade'])
df1.dropna(inplace=True)
df1['cb_person_default_on_file'] = df1['cb_person_default_on_file'].map({'Y':1 ,'N':0})
X = df1.to_numpy()
from sklearn import linear_model
regression = linear_model.LinearRegression()
regression.fit(X_train,y_train)
y_pred = LogisticRegression.predict_proba(X)
Solution
You're using class directly, use object of class LogisticRegression
which is defined in your code as regression = linear_model.LogisticRegression()
Solution:
y_pred = regression.predict_proba(X)
Note:
you're also mixing Linear Regression and Logistic Regression. Remember predict_proba
won't work on regression algos (LinearRegression)
Answered By - Sociopath
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.