You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/hiclass/LocalClassifierPerNode.py:155, in LocalClassifierPerNode.fit(self, X, y, sample_weight)
134 """
135 Fit a local classifier per node.
136
(...)
152 Fitted estimator.
153 """
154 # Execute common methods necessary before fitting
--> 155 super().pre_fit(X, y, sample_weight)
157 # Initialize policy
158 self.binary_policy = self._initialize_binary_policy(calibration=False)
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/hiclass/HierarchicalClassifier.py:159, in HierarchicalClassifier.pre_fit(self, X, y, sample_weight)
154 def pre_fit(self, X, y, sample_weight):
155 # Check that X and y have correct shape
156 # and convert them to np.ndarray if need be
158 if not self.bert:
--> 159 self.X, self.y = self.validate_data(
160 X, y, multi_output=True, accept_sparse="csr", allow_nd=True
161 )
162 else:
163 self.X = np.array(X)
AttributeError: 'LocalClassifierPerNode' object has no attribute '_validate_data'
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
...
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:
Expected behavior
Print out the predictions for the test set
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: