import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import Imputer
import numpy as np
from sklearn.decomposition import PCA
from sklearn.ensemble import RandomForestClassifier
from lightgbm import LGBMClassifier
from xgboost import XGBClassifier
from sklearn.metrics import log_loss
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import train_test_split
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.svm import SVC
from sklearn.linear_model import LogisticRegression
def cvPro(train,label):
x_train,x_test,y_train,y_test = train_test_split(train,label,test_size = 0.3,random_state = 0)
##xgb
xgb_clf = XGBClassifier()
xgb_clf.fit(x_train,y_train)
xgb_test_y = xgb_clf.predict_proba(x_test)
xgb_y_lr_1 = [i[1] for i in xgb_test_y]
loss = log_loss(y_test,xgb_y_lr_1)
print("log_loss is :
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)