Skip to content

Commit

Permalink
Merge pull request #6790 from VesnaT/pls_linear_model
Browse files Browse the repository at this point in the history
PLS: PLSModel as LinearModel
  • Loading branch information
lanzagar authored May 10, 2024
2 parents 7331d38 + 707dca2 commit d8818b5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Orange/regression/pls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
ContinuousVariable, StringVariable
from Orange.data.util import get_unique_names, SharedComputeValue
from Orange.preprocess.score import LearnerScorer
from Orange.regression.base_regression import SklLearnerRegression, \
SklModelRegression
from Orange.regression.base_regression import SklLearnerRegression
from Orange.regression.linear import LinearModel

__all__ = ["PLSRegressionLearner"]

Expand Down Expand Up @@ -75,14 +75,10 @@ def __hash__(self):
return hash((super().__hash__(), self.feature))


class PLSModel(SklModelRegression):
class PLSModel(LinearModel):
var_prefix_X = "PLS T"
var_prefix_Y = "PLS U"

@property
def coefficients(self):
return self.skl_model.coef_

def predict(self, X):
vals = self.skl_model.predict(X)
if len(self.domain.class_vars) == 1:
Expand Down

0 comments on commit d8818b5

Please sign in to comment.