GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (4082)

Orange/clustering/dbscan.py (11 issues)

1
import sklearn.cluster as skl_cluster
0 ignored issues
show
The import sklearn.cluster could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
2
from Orange.data import Table, DiscreteVariable, Domain, Instance
3
from Orange.projection import SklProjector, Projection
4
from numpy import atleast_2d, ndarray, where
0 ignored issues
show
The import numpy could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
Unused where imported from numpy
Loading history...
Unused atleast_2d imported from numpy
Loading history...
5
6
7
__all__ = ["DBSCAN"]
8
9
class DBSCAN(SklProjector):
10
    __wraps__ = skl_cluster.DBSCAN
11
12
    def __init__(self, eps=0.5, min_samples=5, metric='euclidean',
0 ignored issues
show
The argument min_samples seems to be unused.
Loading history...
The argument metric seems to be unused.
Loading history...
The argument eps seems to be unused.
Loading history...
13
                 algorithm='auto', leaf_size=30, p=None,
0 ignored issues
show
The argument leaf_size seems to be unused.
Loading history...
The argument p seems to be unused.
Loading history...
The argument algorithm seems to be unused.
Loading history...
14
                 preprocessors=None):
15
        super().__init__(preprocessors=preprocessors)
16
        self.params = vars()
17
18
    def fit(self, X, Y=None):
19
        proj = skl_cluster.DBSCAN(**self.params)
20
        self.X = X
0 ignored issues
show
The attribute X was defined outside __init__.

It is generally a good practice to initialize all attributes to default values in the __init__ method:

class Foo:
    def __init__(self, x=None):
        self.x = x
Loading history...
21
        if isinstance(X, Table):
22
            proj = proj.fit(X.X,)
23
        else:
24
            proj = proj.fit(X, )
25
        return DBSCANModel(proj)
26
27
28
class DBSCANModel(Projection):
29
    def __init__(self, proj):
30
        super().__init__(proj=proj)
31
32
    def __call__(self, data):
33
        if isinstance(data, ndarray):
34
            return self.proj.fit_predict(data).reshape((len(data), 1))
35
36
        if isinstance(data, Table):
37
            if data.domain is not self.pre_domain:
38
                data = Table(self.pre_domain, data)
39
            y = self.proj.fit_predict(data.X)
40
            vals = [-1] + list(self.proj.core_sample_indices_)
41
            c = DiscreteVariable(name='Core sample index', values=vals)
42
            domain = Domain([c])
43
            return Table(domain, y.reshape(len(y), 1))
44
45
        elif isinstance(data, Instance):
46
            if data.domain is not self.pre_domain:
47
                data = Instance(self.pre_domain, data)
48
            # Instances-by-Instance classification is not defined;
49
            raise Exception("Core sample assignment is not supported "
50
                            "for single instances.")
51