Loan-prediction-using-Machine-Learning-and-Python icon indicating copy to clipboard operation
Loan-prediction-using-Machine-Learning-and-Python copied to clipboard

TypeError: 'str' object is not callable

Open sd-shukla opened this issue 7 years ago • 1 comments

`TypeError Traceback (most recent call last) in () 3 predictors = [x for x in train.columns if x not in [target, IDcol]] 4 xgb2 = XGBClassifier(learning_rate =0.1, n_estimators=1000, max_depth=5, min_child_weight=1, gamma=0, subsample=0.8,colsample_bytree=0.8, objective= 'binary:logistic', nthread=4, scale_pos_weight=1, seed=27) ----> 5 modelfit(xgb2, train, predictors)

in modelfit(alg, dtrain, predictors, useTrainCV, cv_folds, early_stopping_rounds) 20 print ("AUC Score (Train): %f" % metrics.roc_auc_score(dtrain['Loan_Status'], dtrain_predprob)) 21 ---> 22 feat_imp = pd.Series(alg.booster().get_fscore()).sort_values(ascending=False) 23 feat_imp.plot(kind='bar', title='Feature Importances') 24 plt.ylabel('Feature Importance Score')

TypeError: 'str' object is not callable `

sd-shukla avatar Oct 17 '18 04:10 sd-shukla

Its a data type issue when you learn data type you can solve such type of issues you can also used chat gpt to solve this issue it can solve easliy

gagandeep44489 avatar Sep 03 '24 05:09 gagandeep44489