Compare commits
3 Commits
d8035a6705
...
dd58a92eb5
Author | SHA1 | Date |
---|---|---|
Steve L. Nyemba | dd58a92eb5 | |
Steve Nyemba | 8e997675f8 | |
Steve Nyemba | a0a2d8ae56 |
|
@ -182,11 +182,13 @@ class Learner(Process):
|
||||||
|
|
||||||
if self._df[name].size < 5 :
|
if self._df[name].size < 5 :
|
||||||
continue
|
continue
|
||||||
_index = np.random.choice(np.arange(self._df[name].size),5,False)
|
_index = np.random.choice(np.arange(self._df[name].shape[0]),5,False)
|
||||||
no_value = [type(value) in [int,float,np.int64,np.int32,np.float32,np.float64] for value in self._df[name].values[_index]]
|
no_value = [type(value) in [int,float,np.int64,np.int32,np.float32,np.float64] for value in self._df[name].values[_index] if value is not None]
|
||||||
no_value = 0 if np.sum(no_value) > 0 else ''
|
no_value = 0 if np.sum(no_value) > 0 else ''
|
||||||
try:
|
try:
|
||||||
self._df[name] = self._df[name].fillna(no_value)
|
self._df[name] = self._df[name].fillna(no_value)
|
||||||
|
except Exception as e:
|
||||||
|
print (['.... skipping ',name,no_value])
|
||||||
finally:
|
finally:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -591,7 +593,7 @@ class Shuffle(Generator):
|
||||||
_tmpdf = self._df[_columns].copy()[_columns]
|
_tmpdf = self._df[_columns].copy()[_columns]
|
||||||
np.random.seed(1)
|
np.random.seed(1)
|
||||||
np.random.shuffle(_index)
|
np.random.shuffle(_index)
|
||||||
print (_columns,_index)
|
|
||||||
# _values = _tmpdf.values[_index]
|
# _values = _tmpdf.values[_index]
|
||||||
#_tmpdf = _tmpdf.iloc[_index]
|
#_tmpdf = _tmpdf.iloc[_index]
|
||||||
_tmpdf = pd.DataFrame(_tmpdf.values[_index],columns=_columns)
|
_tmpdf = pd.DataFrame(_tmpdf.values[_index],columns=_columns)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
__version__='1.7.2'
|
__version__='1.7.4'
|
||||||
|
|
Loading…
Reference in New Issue