Single model cross validation | teradataml open-source ML functions - Single model cross validation - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
December 2024
ft:locale
en-US
ft:lastEdition
2025-01-23
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage
The following example shows a single model cross validation using td_lightgbm.
return_cvbooster argument is not yet supported for cv().
>>> opt_cv_s = td_lightgbm.cv(params={}, train_set=obj_s1, callbacks=[td_lightgbm.early_stopping(5)])
>>> opt_cv_s
[LightGBM] [Warning] Auto-choosing col-wise multi-threading, the overhead of testing was 0.000058 seconds.
You can set `force_col_wise=true` to remove the overhead.
[LightGBM] [Info] Total Bins 532
[LightGBM] [Info] Number of data points in the train set: 320, number of used features: 4
[LightGBM] [Warning] Auto-choosing col-wise multi-threading, the overhead of testing was 0.000054 seconds.
You can set `force_col_wise=true` to remove the overhead.
[LightGBM] [Info] Total Bins 532
[LightGBM] [Info] Number of data points in the train set: 320, number of used features: 4
[LightGBM] [Warning] Auto-choosing col-wise multi-threading, the overhead of testing was 0.000051 seconds.
You can set `force_col_wise=true` to remove the overhead.
[LightGBM] [Info] Total Bins 532
[LightGBM] [Info] Number of data points in the train set: 320, number of used features: 4
[LightGBM] [Warning] Auto-choosing col-wise multi-threading, the overhead of testing was 0.000045 seconds.
You can set `force_col_wise=true` to remove the overhead.
[LightGBM] [Info] Total Bins 532
[LightGBM] [Info] Number of data points in the train set: 320, number of used features: 4
[LightGBM] [Warning] Auto-choosing col-wise multi-threading, the overhead of testing was 0.000047 seconds.
You can set `force_col_wise=true` to remove the overhead.
[LightGBM] [Info] Total Bins 532
[LightGBM] [Info] Number of data points in the train set: 320, number of used features: 4
Training until validation scores don't improve for 5 rounds
Early stopping, best iteration is:
[57]	cv_agg's l2: 0.067099 + 0.0151336

{'l2-mean': [0.22023353349592326,
  0.19595424631042407,
  ...
  ...
  0.06726610385135459,
  0.06709902214997468],
 'l2-stdv': [0.0015084316502001842,
  0.0029052033405121175,
  ...
  ...
  0.015130340427949404,
  0.015133573776865996]}