Skip to content

AttributeError: 'LocalClassifierPerNode' object has no attribute '_validate_data' #140

@pbahr

Description

@pbahr

Describe the bug
Hi there,

I have pip installed the library and tried to run the Hello HiClass code.

Running the code, I get this error:

AttributeError: 'LocalClassifierPerNode' object has no attribute '_validate_data'

When I looked at the code, I see this line in the hiclass/HierarchicalClassifier.py file:

def _pre_fit(self, X, y, sample_weight):
# Check that X and y have correct shape
# and convert them to np.ndarray if need be

    if not self.bert:
        self.X_, self.y_ = self._validate_data(
            X, y, multi_output=True, accept_sparse="csr", allow_nd=True
        )

...

But I couldn't find the implementation for _validate_data() anywhere in the other classes, e.g. LocalClassifierPerNode

To Reproduce
Steps to reproduce the behavior:

  1. pip install hiclass['xai','ray']
  2. run the Hello HiClass code
  3. You'll probably get the same error as me

Expected behavior
Print out the predictions for the test set

Desktop (please complete the following information):

  • Running the code in the notebook environment for Azure Machine Learning
  • hiClass 4.13.3
  • numpy 1.21.6
  • scipy 1.10.1
  • scikit-learn 0.22.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions