obliquetree 1.0.1__cp312-cp312-win_amd64.whl → 1.0.2__cp312-cp312-win_amd64.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 obliquetree might be problematic. Click here for more details.
- obliquetree/_pywrap.py +20 -3
- obliquetree/src/base.cp312-win_amd64.pyd +0 -0
- obliquetree/src/base.cpp +155 -155
- obliquetree/src/ccp.cp312-win_amd64.pyd +0 -0
- obliquetree/src/ccp.cpp +1 -1
- obliquetree/src/metric.cp312-win_amd64.pyd +0 -0
- obliquetree/src/metric.cpp +1 -1
- obliquetree/src/oblique.cp312-win_amd64.pyd +0 -0
- obliquetree/src/oblique.cpp +155 -155
- obliquetree/src/tree.cp312-win_amd64.pyd +0 -0
- obliquetree/src/tree.cpp +155 -155
- obliquetree/src/utils.cp312-win_amd64.pyd +0 -0
- obliquetree/src/utils.cpp +1 -1
- obliquetree/utils.py +356 -0
- {obliquetree-1.0.1.dist-info → obliquetree-1.0.2.dist-info}/METADATA +1 -1
- obliquetree-1.0.2.dist-info/RECORD +21 -0
- obliquetree-1.0.1.dist-info/RECORD +0 -21
- {obliquetree-1.0.1.dist-info → obliquetree-1.0.2.dist-info}/LICENSE +0 -0
- {obliquetree-1.0.1.dist-info → obliquetree-1.0.2.dist-info}/WHEEL +0 -0
- {obliquetree-1.0.1.dist-info → obliquetree-1.0.2.dist-info}/top_level.txt +0 -0
obliquetree/_pywrap.py
CHANGED
|
@@ -255,11 +255,12 @@ class BaseTree(TreeClassifier):
|
|
|
255
255
|
if not all(isinstance(x, int) for x in categories):
|
|
256
256
|
raise ValueError("All elements in categories must be integers")
|
|
257
257
|
if any(x < 0 for x in categories):
|
|
258
|
-
raise ValueError(
|
|
258
|
+
raise ValueError(
|
|
259
|
+
"All elements in categories must be non-negative integers"
|
|
260
|
+
)
|
|
259
261
|
return list(categories)
|
|
260
262
|
return []
|
|
261
263
|
|
|
262
|
-
|
|
263
264
|
def _validate_use_oblique(self, use_oblique: bool) -> bool:
|
|
264
265
|
if not isinstance(use_oblique, bool):
|
|
265
266
|
raise ValueError("use_oblique must be a boolean")
|
|
@@ -293,6 +294,16 @@ class BaseTree(TreeClassifier):
|
|
|
293
294
|
X = np.asarray(X, order="F", dtype=np.float64)
|
|
294
295
|
y = np.asarray(y, order="C", dtype=np.float64)
|
|
295
296
|
|
|
297
|
+
if X.ndim != 2:
|
|
298
|
+
raise ValueError(
|
|
299
|
+
f"Expected a 2D array for input samples, but got an array with {X.ndim} dimensions."
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
if X.shape[0] != y.shape[0]:
|
|
303
|
+
raise ValueError(
|
|
304
|
+
f"The number of samples in `X` ({X.shape[0]}) does not match the number of target values in `y` ({y.shape[0]})."
|
|
305
|
+
)
|
|
306
|
+
|
|
296
307
|
# Validate target vector
|
|
297
308
|
self._validate_target(y)
|
|
298
309
|
|
|
@@ -411,7 +422,7 @@ class BaseTree(TreeClassifier):
|
|
|
411
422
|
raise ValueError(
|
|
412
423
|
f"Category column index {col_idx} exceeds X dimensions ({X.shape[1]} features)."
|
|
413
424
|
)
|
|
414
|
-
|
|
425
|
+
|
|
415
426
|
# Kategorik sütunlardaki değerler negatif olmamalı
|
|
416
427
|
if (X[:, self.categories] < 0).any():
|
|
417
428
|
raise ValueError(
|
|
@@ -451,6 +462,12 @@ class BaseTree(TreeClassifier):
|
|
|
451
462
|
)
|
|
452
463
|
|
|
453
464
|
X = np.asarray(X, order="F", dtype=np.float64)
|
|
465
|
+
|
|
466
|
+
if X.ndim != 2:
|
|
467
|
+
raise ValueError(
|
|
468
|
+
f"Expected a 2D array for input samples, but got an array with {X.ndim} dimensions. "
|
|
469
|
+
)
|
|
470
|
+
|
|
454
471
|
return super().predict(X)
|
|
455
472
|
|
|
456
473
|
|
|
Binary file
|