perpetual 0.9.1__cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.9.3__cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

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.

Potentially problematic release.


This version of perpetual might be problematic. Click here for more details.

perpetual/booster.py CHANGED
@@ -65,7 +65,9 @@ class PerpetualBooster:
65
65
  objective (str, optional): Learning objective function to be used for optimization. Valid options are:
66
66
  "LogLoss" to use logistic loss (classification),
67
67
  "SquaredLoss" to use squared error (regression),
68
- "QuantileLoss" to use quantile error (regression).
68
+ "QuantileLoss" to use quantile error (regression),
69
+ "HuberLoss" to use huber error (regression),
70
+ "AdaptiveHuberLoss" to use adaptive huber error (regression).
69
71
  Defaults to "LogLoss".
70
72
  budget (float, optional): a positive number for fitting budget. Increasing this number will more
71
73
  likely result in more boosting rounds and more increased predictive power.
@@ -227,7 +229,7 @@ class PerpetualBooster:
227
229
  self.cat_mapping = cat_mapping
228
230
  self.feature_names_in_ = features_
229
231
 
230
- y_, classes_ = convert_input_array(y, self.objective)
232
+ y_, classes_ = convert_input_array(y, self.objective, is_target=True)
231
233
  self.classes_ = np.array(classes_).tolist()
232
234
 
233
235
  if sample_weight is None:
@@ -488,9 +490,10 @@ class PerpetualBooster:
488
490
  axis=1,
489
491
  )
490
492
  else:
491
- raise NotImplementedError(
493
+ warnings.warn(
492
494
  f"predict_proba not implemented for regression. n_classes = {len(self.classes_)}"
493
495
  )
496
+ return np.ones((rows, 1))
494
497
 
495
498
  def predict_log_proba(self, X, parallel: Union[bool, None] = None) -> np.ndarray:
496
499
  """Predict class log-probabilities with the fitted booster on new data.
@@ -524,9 +527,8 @@ class PerpetualBooster:
524
527
  parallel=parallel,
525
528
  )
526
529
  else:
527
- raise NotImplementedError(
528
- "predict_log_proba not implemented for regression."
529
- )
530
+ warnings.warn("predict_log_proba not implemented for regression.")
531
+ return np.ones((rows, 1))
530
532
 
531
533
  def predict_nodes(self, X, parallel: Union[bool, None] = None) -> List:
532
534
  """Predict nodes with the fitted booster on new data.
perpetual/utils.py CHANGED
@@ -32,7 +32,7 @@ def type_series(y):
32
32
  return ""
33
33
 
34
34
 
35
- def convert_input_array(x, objective) -> np.ndarray:
35
+ def convert_input_array(x, objective, is_target=False) -> np.ndarray:
36
36
  classes_ = []
37
37
 
38
38
  if type(x).__module__.split(".")[0] == "numpy":
@@ -49,7 +49,7 @@ def convert_input_array(x, objective) -> np.ndarray:
49
49
  else:
50
50
  x_ = x.to_numpy()
51
51
 
52
- if objective == "LogLoss" and len(x_.shape) == 1:
52
+ if is_target and objective == "LogLoss" and len(x_.shape) == 1:
53
53
  classes_ = np.unique(x_)
54
54
  x_index = np.array([np.where(classes_ == i) for i in x_])
55
55
  if len(classes_) > 2:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: perpetual
3
- Version: 0.9.1
3
+ Version: 0.9.3
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.9
@@ -45,6 +45,7 @@ Project-URL: Source Code, https://github.com/perpetual-ml/perpetual
45
45
  [![Static Badge](https://img.shields.io/badge/join-discord-blue?logo=discord)](https://discord.gg/AyUK7rr6wy)
46
46
  ![PyPI - Downloads](https://img.shields.io/pypi/dm/perpetual)
47
47
 
48
+
48
49
  </div>
49
50
 
50
51
  # Perpetual
@@ -0,0 +1,11 @@
1
+ perpetual-0.9.3.dist-info/METADATA,sha256=LMtEPPxeAQVXSo8ZFIg-GeyMU8m9lBgChGw5qxSGoBE,10594
2
+ perpetual-0.9.3.dist-info/WHEEL,sha256=LVyF9ZNzxVF0Pv_yNwDscEc-4yPApMsUndxUxnmZZi4,131
3
+ perpetual-0.9.3.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
4
+ perpetual/__init__.py,sha256=zzFLkwRr8No7DPUNUQlBXdsdGfT7KEt4orHozdZhS7c,116
5
+ perpetual/booster.py,sha256=4MX7fahwGk4dKVGqZA-_OINw88F03EEoYLFCabUoms4,49863
6
+ perpetual/data.py,sha256=OCuRbjmaY73fOqm_MnI8mgQxAH70cpSOpYaXauaELvs,605
7
+ perpetual/perpetual.cpython-311-aarch64-linux-gnu.so,sha256=3JxZxiYMapujAhMuuPCgzMMoferUYVqX5j6kg8_UXlM,1709232
8
+ perpetual/serialize.py,sha256=Tg2BbuA1jKQ5-ITuVhwtj6hgBaRAbZ66eHctR7fcVk4,1883
9
+ perpetual/types.py,sha256=vBwsX2XnSC8RqdmP2Mr6hDljgWhgGNS6OsuBZM1QdW0,3231
10
+ perpetual/utils.py,sha256=UCY_w5FNOsgn7NKWiLy2uWzYgDdFRTLgRfIM2iAWf8w,7269
11
+ perpetual-0.9.3.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: maturin (1.8.3)
2
+ Generator: maturin (1.8.6)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64
@@ -1,11 +0,0 @@
1
- perpetual-0.9.1.dist-info/METADATA,sha256=uI0NWv8HssqmSq5aOaviUpzo177FyyqkAeo-_TuYWkc,10593
2
- perpetual-0.9.1.dist-info/WHEEL,sha256=Mgc7q3H5chuFJt-w6cZ-qv2aS5dlvenFVMCZtQp77B4,131
3
- perpetual-0.9.1.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
4
- perpetual/__init__.py,sha256=zzFLkwRr8No7DPUNUQlBXdsdGfT7KEt4orHozdZhS7c,116
5
- perpetual/types.py,sha256=vBwsX2XnSC8RqdmP2Mr6hDljgWhgGNS6OsuBZM1QdW0,3231
6
- perpetual/serialize.py,sha256=Tg2BbuA1jKQ5-ITuVhwtj6hgBaRAbZ66eHctR7fcVk4,1883
7
- perpetual/data.py,sha256=OCuRbjmaY73fOqm_MnI8mgQxAH70cpSOpYaXauaELvs,605
8
- perpetual/utils.py,sha256=DToduVbdLPT7-41nXIiVbQ_7IXFo4pI0auY-fz6Qz44,7238
9
- perpetual/booster.py,sha256=XGs2J-SqhCI7T-qZfBgkrE4yQMIy5vy7OBwK8IO3uRs,49686
10
- perpetual/perpetual.cpython-311-aarch64-linux-gnu.so,sha256=emiN7HlABOEIdxSpzC2EW2rUvp3KhX3yYg23UsJUYeA,1643600
11
- perpetual-0.9.1.dist-info/RECORD,,