binboost 0.2.3__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: binboost
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Gradient Boosting Berbasis Aturan Logika Adaptif untuk Fitur Biner
5
5
  Author: Rangga Wahyu Pratama
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  from .binboost import BinBoost
2
2
  from .multiclass import OneVsRestBinBoost
3
3
 
4
- __version__ = "0.2.3"
4
+ __version__ = "0.2.4"
5
5
  __author__ = "Rangga Wahyu Pratama"
6
- __all__ = ["BinBoost"]
6
+ __all__ = ["BinBoost", "OneVsRestBinBoost"]
@@ -4,7 +4,6 @@ import numpy as np
4
4
 
5
5
  class GradientBinarizer:
6
6
  # Binarisasi fitur numerik berbasis korelasi dengan gradien saat ini
7
-
8
7
  def __init__(self, strategy='gradient', n_thresholds='auto'):
9
8
  self.strategy = strategy
10
9
  self.n_thresholds = n_thresholds
@@ -309,6 +309,7 @@ class BinBoost:
309
309
  )
310
310
 
311
311
  numeric_cols = self._detect_numeric_cols(X)
312
+ self.numeric_cols_ = numeric_cols
312
313
  self.ohe_groups_ = self._detect_ohe_groups(X)
313
314
 
314
315
  self._binarizer = GradientBinarizer(
@@ -454,7 +455,7 @@ class BinBoost:
454
455
  self._check_is_fitted()
455
456
  X, _ = self._validate_input(X)
456
457
  F = np.zeros(X.shape[0])
457
- numeric_cols = self._detect_numeric_cols(X)
458
+ numeric_cols = self.numeric_cols_
458
459
  for i, (rule, weights) in enumerate(zip(self.estimators_, self.rule_weights_)):
459
460
  if self.binarize_strategy == 'gradient' and numeric_cols:
460
461
  X_bin = self._binarize_untuk_iterasi(X, i, numeric_cols)
@@ -521,7 +522,7 @@ class BinBoost:
521
522
  """
522
523
  self._check_is_fitted()
523
524
  X, _ = self._validate_input(X)
524
- numeric_cols = self._detect_numeric_cols(X)
525
+ numeric_cols = self.numeric_cols_
525
526
  F = np.zeros(X.shape[0])
526
527
  for i, (rule, weights) in enumerate(zip(self.estimators_, self.rule_weights_)):
527
528
  if self.binarize_strategy == 'gradient' and numeric_cols:
@@ -556,7 +557,7 @@ class BinBoost:
556
557
  """
557
558
  self._check_is_fitted()
558
559
  X, _ = self._validate_input(X)
559
- numeric_cols = self._detect_numeric_cols(X)
560
+ numeric_cols = self.numeric_cols_
560
561
  results = []
561
562
 
562
563
  for i, rule in enumerate(self.estimators_):
@@ -565,8 +566,8 @@ class BinBoost:
565
566
  else:
566
567
  dummy_grad = np.ones(X.shape[0])
567
568
  X_bin, _ = self._binarizer.transform(X, dummy_grad, numeric_cols)
568
- results.append(rule.evaluate(X_bin))
569
-
569
+ results.append(rule.evaluate(X_bin))
570
+
570
571
  return np.column_stack(results)
571
572
 
572
573
  def get_params(self, deep=True):
@@ -4,12 +4,6 @@ from .binboost import BinBoost
4
4
 
5
5
 
6
6
  class OneVsRestBinBoost:
7
- """
8
- Ekstensi BinBoost untuk klasifikasi multi-kelas (>2 kelas) lewat strategi
9
- One-vs-Rest, mirip pola sklearn.multiclass.OneVsRestClassifier.
10
- Untuk 2 kelas, gunakan langsung BinBoost.
11
- """
12
-
13
7
  def __init__(self, mode='multiclass', **binboost_params):
14
8
  self.mode = mode
15
9
  self.binboost_params = binboost_params
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: binboost
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Gradient Boosting Berbasis Aturan Logika Adaptif untuk Fitur Biner
5
5
  Author: Rangga Wahyu Pratama
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "binboost"
7
- version = "0.2.3"
7
+ version = "0.2.4"
8
8
  description = "Gradient Boosting Berbasis Aturan Logika Adaptif untuk Fitur Biner"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="binboost",
5
- version="0.2.3",
5
+ version="0.2.4",
6
6
  author="Rangga Wahyu Pratama",
7
7
  description="Gradient Boosting Berbasis Aturan Logika Adaptif untuk Fitur Biner",
8
8
  long_description=open("README.md", encoding="utf-8").read(),
File without changes
File without changes
File without changes
File without changes
File without changes