8000 [MRG + 2] Export ClassificationCriterion and RegressionCriterion (#10… · scikit-learn/scikit-learn@d523243 · GitHub
[go: up one dir, main page]

Skip to content

Commit d523243

Browse files
camilstapsglemaitre
authored andcommitted
[MRG + 2] Export ClassificationCriterion and RegressionCriterion (#10325)
1 parent c9e6d4d commit d523243

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

sklearn/tree/_criterion.pxd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,14 @@ cdef class Criterion:
6565
cdef void node_value(self, double* dest) nogil
6666
cdef double impurity_improvement(self, double impurity) nogil
6767
cdef double proxy_impurity_improvement(self) nogil
68+
69+
cdef class ClassificationCriterion(Criterion):
70+
"""Abstract criterion for classification."""
71+
72+
cdef SIZE_t* n_classes
73+
cdef SIZE_t sum_stride
74+
75+
cdef class RegressionCriterion(Criterion):
76+
"""Abstract regression criterion."""
77+
78+
cdef double sq_sum_total

sklearn/tree/_criterion.pyx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,6 @@ cdef class Criterion:
212212
cdef class ClassificationCriterion(Criterion):
213213
"""Abstract criterion for classification."""
214214

215-
cdef SIZE_t* n_classes
216-
cdef SIZE_t sum_stride
217-
218215
def __cinit__(self, SIZE_t n_outputs,
219216
np.ndarray[SIZE_t, ndim=1] n_classes):
220217
"""Initialize attributes for this criterion.
@@ -704,8 +701,6 @@ cdef class RegressionCriterion(Criterion):
704701
= (\sum_i^n y_i ** 2) - n_samples * y_bar ** 2
705702
"""
706703

707-
cdef double sq_sum_total
708-
709704
def __cinit__(self, SIZE_t n_outputs, SIZE_t n_samples):
710705
"""Initialize parameters for this criterion.
711706

0 commit comments

Comments
 (0)
0