Skip to content

Multi-output #196

@briandesilva

Description

@briandesilva

Hi, very interesting package! I might be doing something wrong, but I also may have found a bug. The pyuoi linear models are subclasses of sklearn.base.MultiOutputMixin (i.e. isinstance(model, MultiOutputMixin) evaluates to True), but they don't appear to support multiple targets.

Minimal working example:

import numpy as np
from pyuoi.linear_model import UoI_ElasticNet

x = np.ones((5, 2))
model = UoI_ElasticNet()
model.fit(x, x)

Error message:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-28-41f22fb29892> in <module>
      3 x = np.ones((5, 2))
      4 model = UoI_ElasticNet()
----> 5 model.fit(x, x)

~/venv/lib/python3.6/site-packages/pyuoi/linear_model/base.py in fit(self, X, y, stratify, verbose)
    199             self._logger.setLevel(logging.WARNING)
    200 
--> 201         X, y = self._pre_fit(X, y)
    202 
    203         X, y = check_X_y(X, y, accept_sparse=['csr', 'csc', 'coo'],

~/venv/lib/python3.6/site-packages/pyuoi/linear_model/base.py in _pre_fit(self, X, y)
    538             if y.shape[1] > 1:
    539                 raise ValueError('y should either have shape ' +
--> 540                                  '(n_samples, ) or (n_samples, 1).')
    541         else:
    542             raise ValueError('y should either have shape ' +

ValueError: y should either have shape (n_samples, ) or (n_samples, 1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions