|
|
@ -306,7 +306,7 @@ class Shuffle(Generator):
|
|
|
|
This is a method that will yield data with low utility
|
|
|
|
This is a method that will yield data with low utility
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
def __init__(self,**_args):
|
|
|
|
def __init__(self,**_args):
|
|
|
|
super().__init__(self)
|
|
|
|
super().__init__(**_args)
|
|
|
|
def run(self):
|
|
|
|
def run(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -315,7 +315,8 @@ class Shuffle(Generator):
|
|
|
|
np.random.shuffle(_index)
|
|
|
|
np.random.shuffle(_index)
|
|
|
|
_iocolumns = self.info['columns']
|
|
|
|
_iocolumns = self.info['columns']
|
|
|
|
_ocolumns = list(set(self._df.columns) - set(_iocolumns) )
|
|
|
|
_ocolumns = list(set(self._df.columns) - set(_iocolumns) )
|
|
|
|
_iodf = pd.DataFrame(self._df[_ocolumns],self._df.loc[_index][_iocolumns],index=np.arange(self._df.shape[0]))
|
|
|
|
# _iodf = pd.DataFrame(self._df[_ocolumns],self._df.loc[_index][_iocolumns],index=np.arange(_index.size))
|
|
|
|
|
|
|
|
_iodf = pd.DataFrame(self._df[_iocolumns],index = np.arange(_index.size))
|
|
|
|
self._df = self._df[_ocolumns].join(_iodf)
|
|
|
|
self._df = self._df[_ocolumns].join(_iodf)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -337,7 +338,7 @@ class factory :
|
|
|
|
:param batch (default 2k) size of the batch
|
|
|
|
:param batch (default 2k) size of the batch
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
if _args['apply'] == 'shuffe' :
|
|
|
|
if _args['apply'] == 'shuffle' :
|
|
|
|
return Shuffle(**_args)
|
|
|
|
return Shuffle(**_args)
|
|
|
|
elif _args['apply'] == 'generate' :
|
|
|
|
elif _args['apply'] == 'generate' :
|
|
|
|
return Generator(**_args)
|
|
|
|
return Generator(**_args)
|
|
|
|