Skip to content

Commit d51cd79

Browse files
committed
added is_multi_resp attribute
1 parent c84f170 commit d51cd79

7 files changed

Lines changed: 17 additions & 0 deletions

ya_glm/models/huber_regression.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55

66
class HuberRegMixin(LinRegMixin):
7+
is_multi_resp = False
78

89
@autoassign
910
def __init__(self, knot=1.35): pass
@@ -16,6 +17,8 @@ def get_loss_info(self):
1617

1718

1819
class HuberRegMultiResponseMixin(LinRegMultiResponseMixin):
20+
is_multi_resp = True
21+
1922
@autoassign
2023
def __init__(self, knot=1.35): pass
2124

ya_glm/models/linear_regression.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
class LinRegMixin(RegressorMixin):
1212

13+
is_multi_resp = False
14+
15+
1316
def get_loss_info(self):
1417
loss_type = 'lin_reg'
1518
loss_kws = {}

ya_glm/models/linear_regression_multi_resp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
class LinRegMultiResponseMixin(LinRegMixin):
77

8+
is_multi_resp = True
9+
810
def get_loss_info(self):
911
loss_type = 'lin_reg_mr'
1012
loss_kws = {}

ya_glm/models/logistic_regression.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
class LogRegMixin(LinearClassifierMixin):
1717

18+
is_multi_resp = False
19+
1820
def get_loss_info(self):
1921
loss_type = 'log_reg'
2022
loss_kws = {}

ya_glm/models/multinomial.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
class MultinomialMixin(LinearClassifierMixin):
1313

14+
is_multi_resp = True
15+
1416
def get_loss_info(self):
1517
loss_type = 'multinomial'
1618
loss_kws = {}

ya_glm/models/poisson_regression.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88

99
class PoissonRegMixin(RegressorMixin):
10+
is_multi_resp = False
1011

1112
def get_loss_info(self):
1213
loss_type = 'poisson'
@@ -41,6 +42,8 @@ def score(self, X, y, sample_weight=None):
4142

4243
class PoissonRegMultiResponseMixin(RegressorMixin):
4344

45+
is_multi_resp = True
46+
4447
def get_loss_info(self):
4548
loss_type = 'poisson_mr'
4649
loss_kws = {}

ya_glm/models/quantile_regression.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
class QuantileRegMixin(LinRegMixin):
88

9+
is_multi_resp = False
10+
911
@autoassign
1012
def __init__(self, quantile=0.5): pass
1113

0 commit comments

Comments
 (0)