AxeldeRomblay / MLBox

MLBox is a powerful Automated Machine Learning python library.
https://mlbox.readthedocs.io/en/latest/
Other
1.49k stars 274 forks source link

Drift computation error #50

Closed brunosez closed 6 years ago

brunosez commented 6 years ago

Hi Axel, On a fresh install , I have this error at he Drift computation any idea ? with the classification example.

Thanks

Bruno OS Ubuntu 14.04

computing drifts ...

IndexError Traceback (most recent call last)

in () 1 dft = Drift_thresholder() ----> 2 df = dft.fit_transform(df) /home/bruno/anaconda3/lib/python3.6/site-packages/mlbox/preprocessing/drift_thresholder.py in fit_transform(self, df) 108 print("computing drifts ...") 109 --> 110 ds.fit(pp.transform(df['train']), pp.transform(df['test'])) 111 112 if (self.verbose): /home/bruno/anaconda3/lib/python3.6/site-packages/mlbox/preprocessing/drift/drift_threshold.py in fit(self, df_train, df_test) 163 self.stratify, 164 self.random_state) --> 165 for col in df_train.columns) 166 167 for i, col in enumerate(df_train.columns): /home/bruno/anaconda3/lib/python3.6/site-packages/joblib/parallel.py in __call__(self, iterable) 777 # was dispatched. In particular this covers the edge 778 # case of Parallel used with an exhausted iterator. --> 779 while self.dispatch_one_batch(iterator): 780 self._iterating = True 781 else: /home/bruno/anaconda3/lib/python3.6/site-packages/joblib/parallel.py in dispatch_one_batch(self, iterator) 618 619 with self._lock: --> 620 tasks = BatchedCalls(itertools.islice(iterator, batch_size)) 621 if len(tasks) == 0: 622 # No more tasks available in the iterator: tell caller to stop. /home/bruno/anaconda3/lib/python3.6/site-packages/joblib/parallel.py in __init__(self, iterator_slice) 125 126 def __init__(self, iterator_slice): --> 127 self.items = list(iterator_slice) 128 self._size = len(self.items) 129 /home/bruno/anaconda3/lib/python3.6/site-packages/mlbox/preprocessing/drift/drift_threshold.py in (.0) 163 self.stratify, 164 self.random_state) --> 165 for col in df_train.columns) 166 167 for i, col in enumerate(df_train.columns): /home/bruno/anaconda3/lib/python3.6/site-packages/pandas/core/indexing.py in __getitem__(self, key) 1284 return self._getitem_tuple(key) 1285 else: -> 1286 return self._getitem_axis(key, axis=0) 1287 1288 def _getitem_axis(self, key, axis=0): /home/bruno/anaconda3/lib/python3.6/site-packages/pandas/core/indexing.py in _getitem_axis(self, key, axis) 1573 self._is_valid_integer(key, axis) 1574 -> 1575 return self._get_loc(key, axis=axis) 1576 1577 def _convert_to_indexer(self, obj, axis=0, is_setter=False): /home/bruno/anaconda3/lib/python3.6/site-packages/pandas/core/indexing.py in _get_loc(self, key, axis) 94 95 def _get_loc(self, key, axis=0): ---> 96 return self.obj._ixs(key, axis=axis) 97 98 def _slice(self, obj, axis=0, kind=None): /home/bruno/anaconda3/lib/python3.6/site-packages/pandas/core/frame.py in _ixs(self, i, axis) 1904 return self[i] 1905 else: -> 1906 label = self.index[i] 1907 if isinstance(label, Index): 1908 # a location index by definition /home/bruno/anaconda3/lib/python3.6/site-packages/pandas/indexes/base.py in __getitem__(self, key) 1265 1266 key = _values_from_object(key) -> 1267 result = getitem(key) 1268 if not lib.isscalar(result): 1269 return promote(result) IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
AxeldeRomblay commented 6 years ago

Thank you @brunosez for reporting the issue.. I will correct this soon !

AxeldeRomblay commented 6 years ago

Issue solved ! :)

brunosez commented 6 years ago

Thanks, How can I benefit from the patch ? or is there any simple workaround ? Rgds Bruno

AxeldeRomblay commented 6 years ago

Sorry ?