EpistasisLab / tpot

A Python Automated Machine Learning tool that optimizes machine learning pipelines using genetic programming.
http://epistasislab.github.io/tpot/
GNU Lesser General Public License v3.0
9.73k stars 1.57k forks source link

When I am trying to run tpot for classification problem. It is throwing me an error of Cannot index with multidimensional key #899

Open Nikhileshorg opened 5 years ago

Nikhileshorg commented 5 years ago

ValueError Traceback (most recent call last)

in 6 scoring='accuracy') 7 ----> 8 tpot.fit(train.drop('isFraud',axis=1).loc[train].values, 9 train.loc[train,'isFraud'].values) C:\ProgramData\New folder\lib\site-packages\pandas\core\indexing.py in __getitem__(self, key) 1498 1499 maybe_callable = com.apply_if_callable(key, self.obj) -> 1500 return self._getitem_axis(maybe_callable, axis=axis) 1501 1502 def _is_scalar_access(self, key): C:\ProgramData\New folder\lib\site-packages\pandas\core\indexing.py in _getitem_axis(self, key, axis) 1898 1899 if hasattr(key, 'ndim') and key.ndim > 1: -> 1900 raise ValueError('Cannot index with multidimensional key') 1901 1902 return self._getitem_iterable(key, axis=axis) **ValueError: Cannot index with multidimensional key** ----------------------------------------------------------------------------------- What to do if we get this type of issue !!!! Please help !!! Thanks in advance.
weixuanfu commented 5 years ago

I think this issue is related to how to use .loc of pandas.Dataframe. I think the train maybe a multidimensional key. If so, please convert it to a 1D indexer.