全球AI挑战赛之虚拟股票预测,冠军

全球AI挑战赛之虚拟股票预测,冠军,第1张

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 :&#

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/569231.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-09
下一篇 2022-04-09

发表评论

登录后才能评论

评论列表(0条)

保存