Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning #780

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions orangecontrib/spectroscopy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
import Orange.data
import os.path


# Remove this when we require Orange 3.34
if not hasattr(Orange.data.Table, "get_column"):
def get_column(self, column):
col, _ = self.get_column_view(column)
if self.domain[column].is_primitive():
col = col.astype(float)
return col

Orange.data.Table.get_column = get_column

from . import io # register file formats


Expand Down
5 changes: 0 additions & 5 deletions orangecontrib/spectroscopy/models/pls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import numpy as np
import pkg_resources
import sklearn
import sklearn.cross_decomposition as skl_pls

from Orange.data import Table, Domain, Variable, \
Expand Down Expand Up @@ -62,9 +60,6 @@ class PLSModel(SklModel):
@property
def coefficients(self):
coef = self.skl_model.coef_
# 1.3 has transposed coef_
if pkg_resources.parse_version(sklearn.__version__) < pkg_resources.parse_version("1.3.0"):
coef = coef.T
return coef

def predict(self, X):
Expand Down
5 changes: 0 additions & 5 deletions orangecontrib/spectroscopy/tests/test_owpls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import numpy as np

import pkg_resources
import sklearn
from sklearn.cross_decomposition import PLSRegression

from Orange.data import Table, Domain, ContinuousVariable
Expand All @@ -25,9 +23,6 @@ def table(rows, attr, vars):

def coefficients(sklmodel):
coef = sklmodel.coef_
# 1.3 has transposed coef_
if pkg_resources.parse_version(sklearn.__version__) < pkg_resources.parse_version("1.3.0"):
coef = coef.T
return coef


Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ def include_documentation(local_dir, install_dir):
package_data=PACKAGE_DATA,
data_files=DATA_FILES,
install_requires=[
'setuptools>=36.3', # same as for Orange 3.28
'pip>=9.0', # same as for Orange 3.28
'setuptools>=51.0.0', # same as the last one needed for Orange3
'pip>=19.3', # same as for Orange 3.37
'numpy>=1.21.0,<2.0.0',
'Orange3>=3.37.0',
'orange-canvas-core>=0.2.0',
Expand Down
Loading