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

Could not create feature extractor object #6

Open
laurelrr opened this issue Feb 1, 2023 · 0 comments · Fixed by annie444/SLEAPyFaces#1 or #7
Open

Could not create feature extractor object #6

laurelrr opened this issue Feb 1, 2023 · 0 comments · Fixed by annie444/SLEAPyFaces#1 or #7
Labels
bug Something isn't working

Comments

@laurelrr
Copy link
Contributor

laurelrr commented Feb 1, 2023

from sleapyfaces.clustering import FeatureExtractor
FE = FeatureExtractor(expr, ['eye','ear','whisker','nostril','mouth'])

2023-02-01 15:15:08,180 - root - INFO - Extracting Features...

ValueError Traceback (most recent call last)
Cell In[36], line 2
1 from sleapyfaces.clustering import FeatureExtractor
----> 2 FE = FeatureExtractor(expr, ['eye','ear','whisker','nostril','mouth'])
3 expr.cols

File /nadata/snlkt/home/lkeyes/Projects/GIT/SLEAPyFaces/sleapyfaces/clustering/features.py:122, in FeatureExtractor.init(self, dataObject, base_features)
118 qual_data: pd.DataFrame = all_data.loc[:, self.classes]
119 qual_data: pd.DataFrame = qual_data.loc[
120 :, ~qual_data.columns.duplicated()
121 ].copy()
--> 122 qual_data.columns = pd.MultiIndex.from_product([["Classes"], self.classes])
123 self.qual_cols: list[str] = qual_data.columns.to_list()
124 self.data = pd.concat([qual_data, num_data], axis=1)

File ~/anaconda3/envs/sleapyfaces/lib/python3.10/site-packages/pandas/core/generic.py:5915, in NDFrame.setattr(self, name, value)
5913 try:
5914 object.getattribute(self, name)
-> 5915 return object.setattr(self, name, value)
5916 except AttributeError:
5917 pass

File ~/anaconda3/envs/sleapyfaces/lib/python3.10/site-packages/pandas/_libs/properties.pyx:69, in pandas._libs.properties.AxisProperty.set()

File ~/anaconda3/envs/sleapyfaces/lib/python3.10/site-packages/pandas/core/generic.py:823, in NDFrame._set_axis(self, axis, labels)
821 def _set_axis(self, axis: int, labels: AnyArrayLike | list) -> None:
822 labels = ensure_index(labels)
--> 823 self._mgr.set_axis(axis, labels)
824 self._clear_item_cache()

File ~/anaconda3/envs/sleapyfaces/lib/python3.10/site-packages/pandas/core/internals/managers.py:230, in BaseBlockManager.set_axis(self, axis, new_labels)
228 def set_axis(self, axis: int, new_labels: Index) -> None:
229 # Caller is responsible for ensuring we have an Index object.
--> 230 self._validate_set_axis(axis, new_labels)
231 self.axes[axis] = new_labels

File ~/anaconda3/envs/sleapyfaces/lib/python3.10/site-packages/pandas/core/internals/base.py:70, in DataManager._validate_set_axis(self, axis, new_labels)
67 pass
69 elif new_len != old_len:
---> 70 raise ValueError(
71 f"Length mismatch: Expected axis has {old_len} elements, new "
72 f"values have {new_len} elements"
73 )

ValueError: Length mismatch: Expected axis has 6 elements, new values have 8 elements

@annie444 annie444 linked a pull request Feb 2, 2023 that will close this issue
@laurelrr laurelrr added the bug Something isn't working label Feb 6, 2023
@laurelrr laurelrr linked a pull request Feb 6, 2023 that will close this issue
@Tyelab Tyelab locked as resolved and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant