cran2367 / sgt

Sequence Graph Transform
104 stars 21 forks source link

Value error when fitting protein dataset #7

Open datashinobi opened 3 years ago

datashinobi commented 3 years ago

Using the protein dataset sample with flattenning deactivated fail

SGT version 2.0.3 pandas version 1.0.3


sgt_ = SGT(kappa=1, 
           lengthsensitive=False,
           flatten=False,
           mode='default')

sgtembedding_df = sgt_.fit_transform(corpus)```

`---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<timed exec> in <module>

~/anaconda3/envs/amlmodules_env/lib/python3.7/site-packages/sgt/sgt.py in fit_transform(self, corpus)
    204                                axis=1,
    205                                result_type='expand')
--> 206             sgt.columns = ['id'] + self.feature_names
    207             return sgt
    208         elif self.mode=='multiprocessing':

~/anaconda3/envs/amlmodules_env/lib/python3.7/site-packages/pandas/core/generic.py in __setattr__(self, name, value)
   5190         try:
   5191             object.__getattribute__(self, name)
-> 5192             return object.__setattr__(self, name, value)
   5193         except AttributeError:
   5194             pass

pandas/_libs/properties.pyx in pandas._libs.properties.AxisProperty.__set__()

~/anaconda3/envs/amlmodules_env/lib/python3.7/site-packages/pandas/core/generic.py in _set_axis(self, axis, labels)
    688 
    689     def _set_axis(self, axis, labels):
--> 690         self._data.set_axis(axis, labels)
    691         self._clear_item_cache()
    692 

~/anaconda3/envs/amlmodules_env/lib/python3.7/site-packages/pandas/core/internals/managers.py in set_axis(self, axis, new_labels)
    181             raise ValueError(
    182                 "Length mismatch: Expected axis has {old} elements, new "
--> 183                 "values have {new} elements".format(old=old_len, new=new_len)
    184             )
    185 

ValueError: Length mismatch: Expected axis has 21 elements, new values have 401 elements`
cran2367 commented 3 years ago

@datashinobi thank you for catching the error. I'll look into it in next few days. In the meantime, if you could find the bug please comment.

busraoguzoglu commented 3 years ago

Hello! Is there any update regarding this issue? Having the same error right now, while fitting protein dataset.

cran2367 commented 3 years ago

@busraoguzoglu the issue is still open and in-progress. I will have this fixed soon. If you are on a deadline please let me know.

busraoguzoglu commented 3 years ago

Thanks a lot for your fast reply! I am not on a strict deadline for now. If I can find anything about the source of this issue I will comment here.

busraoguzoglu commented 2 years ago

Hello! Is this issue still open?