CatBoost参数解释和实战

更新时间:2023-05-20 09:00:40 阅读: 评论:0

CatBoost参数解释和实战
据开发者所说超越Lightgbm和XGBoost的⼜⼀个神器,不过具体性能,还要看在⽐赛中的表现了。
整理⼀下⾥⾯简单的教程和参数介绍,很多参数不是那种重要,只解释部分重要的参数,训练时需要重点考虑的。Quick start
CatBoostClassifier
import numpy as np
import catboost as cb
在线翻译有道train_data = np.random.randint(0,100, size=(100,10))
train_label = np.random.randint(0,2, size=(100))
test_data = np.random.randint(0,100, size=(50,10))
model = cb.CatBoostClassifier(iterations=2, depth=2, learning_rate=0.5, loss_function='Logloss',
logging_level='Verbo')
model.fit(train_data, train_label, cat_features=[0,2,5])
preds_class = model.predict(test_data)
preds_probs = model.predict_proba(test_data)
print('class = ',preds_class)
print('proba = ',preds_probs)
CatBoostClassifier/CatBoostRegressor
通⽤参数
learning_rate(eta)=automatically
depth(max_depth)=6: 树的深度
l2_leaf_reg(reg_lambda)=3 L2正则化系数
n_estimators(num_boost_round)(num_trees=1000)=1000: 解决ml问题的树的最⼤数量
one_hot_max_size=2: 对于某些变量进⾏one-hot编码
loss_function=‘Logloss’:
RMSE
Logloss
MAE
CrossEntropy
custom_metric=None
RMSE
Logloss
MAE
CrossEntropy
Recall
Precision
F1
Accuracy
AUC
R2
妮娜 杜波夫男友eval_metric=Optimized objective
RMSE
Logloss
MAE
CrossEntropy
Recall
Precision
F1
Accuracy
AUCappreciates
R2
nan_mode=None:处理NAN的⽅法
Forbidden
Min
Max
leaf_estimation_method=None:迭代求解的⽅法,梯度和⽜顿
Newton
Gradient
random_ed=None: 训练时候的随机种⼦
性能参数
thread_count=-1:训练时所⽤的cpu/gpu核数情归巴黎
google 翻译ud_ram_limit=None:CTR问题,计算时的内存限制
gpu_ram_part=None:GPU内存限制
处理单元设置
task_type=CPU:训练的器件
devices=None:训练的GPU设备ID
counter_calc_method=None,
leaf_estimation_iterations=None,
u_best_model=None,
verbo=None,
model_size_reg=None,
rsm=None,
武汉大数据培训机构logging_level=None,
metric_period=None,
ctr_leaf_count_limit=None,
store_all_simple_ctr=None,
max_ctr_complexity=None,
has_time=None,
class_count=None,
class_weights=None,
random_strength=None,
name=None,
ignored_features=None,
train_dir=None,
custom_loss=None,
bagging_temperature=None
border_count=None
好奇小猴乔治
feature_border_type=None,
save_snapshot=None,
snapshot_file=None,
fold_len_multiplier=None,
allow_writing_files=None,
final_ctr_computation_mode=None,
approx_on_full_history=None,
boosting_type=None,
simple_ctr=None,
combinations_ctr=None,
per_feature_ctr=None,
device_config=None,
bootstrap_type=None,
subsample=None,
colsample_bylevel=None,
random_state=None,
objective=None,
max_bin=None,
scale_pos_weight=None,
gpu_cat_features_storage=None,
data_partition=None
属性(attribute):
is_fitted_
tree_count_
feature_importances_
random_ed_
⽅法(method):
X: 输⼊数据数据类型可以是,list; pandas.DataFrame; pandas.Series y=None
cat_features=None: 拿来做处理的类别特征
sample_weight=None: 输⼊数据的样本权重
logging_level=None: 控制是否输出⽇志信息,或者何种信息
plot=Fal: 训练过程中,绘制,度量值,所⽤时间等
eval_t=None: 验证集合,数据类型list(X, y)tuples
baline=None
u_best_model=None
verbo=None
返回验证样本所属类别,数据类型为np.array
返回验证样本所属类别的概率,数据类型为np.array
save_model
pearliteload_model新东方周思成
get_params
score
冰血暴第二季

本文发布于:2023-05-20 09:00:40,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/115604.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:训练   参数   类别
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图