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

pca and rfc errors #42

Open
krl513 opened this issue May 1, 2024 · 1 comment
Open

pca and rfc errors #42

krl513 opened this issue May 1, 2024 · 1 comment

Comments

@krl513
Copy link

krl513 commented May 1, 2024

Hi all,

I'm attempting to run my DLC outputs through ALMA for gait kinematics. Kinematic analysis successfully runs and provides the appropriate output. When attempting the further data analysis options, neither the random forest classifier nor the principal components analysis would successfully run. I received the same error for both RFC and PCA:

Traceback (most recent call last):
  File "C:\Users\ML\anaconda3\envs\alma_38\lib\site-packages\pandas\core\indexes\base.py", line 2646, in get_loc
    return self._engine.get_loc(key)
  File "pandas\_libs\index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'cycle duration (no. frames)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\Kate\alma\alma\Panels\PCA.py", line 218, in PCA
    combined_df = DataAnalysisFunctions.combine_files(file_lists, group_names, self.output_path, 'average')
  File "E:\Kate\alma\alma\Functions\DataAnalysisFunctions.py", line 36, in combine_files
    df = df[df['cycle duration (no. frames)'] >= 0]
  File "C:\Users\ML\anaconda3\envs\alma_38\lib\site-packages\pandas\core\frame.py", line 2800, in __getitem__
    indexer = self.columns.get_loc(key)
  File "C:\Users\ML\anaconda3\envs\alma_38\lib\site-packages\pandas\core\indexes\base.py", line 2648, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas\_libs\index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'cycle duration (no. frames)'

It seems like the error is related to the amount/quality of data I am trying to use (the videos used were a bit short and mice were poorly trained to walk on the treadmill). Can someone please explain why I am seeing this error? Why is ALMA capable of successfully extracting the kinematic parameters but no further analysis? Thank you!

@sollan
Copy link
Owner

sollan commented May 19, 2024

Hi, it looks like you're inputting some file(s) that do not contain a "cycle duration (no. frames)" column. Hence the KeyError.

Can you please double check that the folders you're using as the path to the input files for data analysis do not contain any file that is not an output from the parameter extraction by ALMA?

Best,
Annette

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants