当前位置:   article > 正文

XGBoost Demo

xgboost demo
import numpy as np
import pandas as pd
import xgboost as xgb
from sklearn.cross_validation import train_test_split
import os
import csv

#from xgboost.sklearn import XGBClassifier
#from sklearn import cross_validation, metrics   #Additional scklearn functions
#from sklearn.grid_search import GridSearchCV   #Perforing grid search
#
#import matplotlib.pylab as plt
#from matplotlib.pylab import rcParams

#记录程序运行时间
import time
start_time = time.time()

#读入数据
current_dir = os.path.abspath('.')
train = pd.read_csv("train_data.csv")
tests = pd.read_csv("test_data.csv")

params={
'booster':'gbtree',
'objective': 'reg:linear', #多分类的问题
'gamma':0.1,  # 用于控制是否后剪枝的参数,
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/97418
推荐阅读
相关标签
  

闽ICP备14008679号