MCPcopy Create free account
hub / github.com/catboost/catboost / quantize

Method quantize

catboost/python-package/catboost/core.py:1239–1323  ·  view source on GitHub ↗

Quantize this pool Parameters ---------- pool : catboost.Pool Dataset to quantize. ignored_features : list, [default=None] Indices or names of features that should be excluded when training. per_float_feature_quantization :

(self, ignored_features=None, per_float_feature_quantization=None, border_count=None,
                 max_bin=None, feature_border_type=None, sparse_features_conflict_fraction=None,
                 nan_mode=None, input_borders=None, task_type=None, used_ram_limit=None, random_seed=None, **kwargs)

Source from the content-addressed store, hash-verified

1237 self._save(fname)
1238
1239 def quantize(self, ignored_features=None, per_float_feature_quantization=None, border_count=None,
1240 max_bin=None, feature_border_type=None, sparse_features_conflict_fraction=None,
1241 nan_mode=None, input_borders=None, task_type=None, used_ram_limit=None, random_seed=None, **kwargs):
1242 """
1243 Quantize this pool
1244
1245 Parameters
1246 ----------
1247 pool : catboost.Pool
1248 Dataset to quantize.
1249
1250 ignored_features : list, [default=None]
1251 Indices or names of features that should be excluded when training.
1252
1253 per_float_feature_quantization : list of strings, [default=None]
1254 List of float binarization descriptions.
1255 Format : described in documentation on catboost.ai
1256 Example 1: ['0:1024'] means that feature 0 will have 1024 borders.
1257 Example 2: ['0:border_count=1024', '1:border_count=1024', ...] means that two first features have 1024 borders.
1258 Example 3: ['0:nan_mode=Forbidden,border_count=32,border_type=GreedyLogSum',
1259 '1:nan_mode=Forbidden,border_count=32,border_type=GreedyLogSum'] - defines more quantization properties for first two features.
1260
1261 border_count : int, [default = 254 for training on CPU or 128 for training on GPU]
1262 The number of partitions in numeric features binarization. Used in the preliminary calculation.
1263 range: [1,65535] on CPU, [1,255] on GPU
1264
1265 max_bin : float, synonym for border_count.
1266
1267 feature_border_type : string, [default='GreedyLogSum']
1268 The binarization mode in numeric features binarization. Used in the preliminary calculation.
1269 Possible values:
1270 - 'Median'
1271 - 'Uniform'
1272 - 'UniformAndQuantiles'
1273 - 'GreedyLogSum'
1274 - 'MaxLogSum'
1275 - 'MinEntropy'
1276
1277 sparse_features_conflict_fraction : float, [default=0.0]
1278 CPU only. Maximum allowed fraction of conflicting non-default values for features in exclusive features bundle.
1279 Should be a real value in [0, 1) interval.
1280
1281 nan_mode : string, [default=None]
1282 Way to process missing values for numeric features.
1283 Possible values:
1284 - 'Forbidden' - raises an exception if there is a missing value for a numeric feature in a dataset.
1285 - 'Min' - each missing value will be processed as the minimum numerical value.
1286 - 'Max' - each missing value will be processed as the maximum numerical value.
1287 If None, then nan_mode=Min.
1288
1289 input_borders : string or os.PathLike, [default=None]
1290 input file with borders used in numeric features binarization.
1291
1292 task_type : string, [default=None]
1293 The calcer type that will be used to train the model after quantization.
1294 Possible values:
1295 - 'CPU'
1296 - 'GPU'

Calls 4

CatBoostErrorClass · 0.50
popMethod · 0.45
formatMethod · 0.45