bug fix ... forgot to update a redundancy

This commit is contained in:
Steve Nyemba 2020-04-14 16:01:23 -05:00
parent ed86ff0add
commit 1cf9c6e47a
1 changed files with 6 additions and 3 deletions

View File

@ -176,6 +176,7 @@ class Binary :
col_count = N col_count = N
matrix = [ np.zeros(col_count,dtype=np.float32) for i in np.arange(row_count)] matrix = [ np.zeros(col_count,dtype=np.float32) for i in np.arange(row_count)]
# #
# let's create a binary matrix of the feature that was passed in # let's create a binary matrix of the feature that was passed in
@ -203,10 +204,12 @@ class Binary :
# Let's treat the case of missing values i.e nulls # Let's treat the case of missing values i.e nulls
# #
row_count,col_count = column.size,values.size row_count,col_count = column.size,values.size
if row_count * col_count > size and row_count < size: if col_count > size :
N = np.divide(size,row_count).astype(int) # N = np.divide(size,row_count).astype(int)
i = np.random.choice(col_count,N) # N =
i = np.random.choice(col_count,size)
values = values[-i] values = values[-i]
col_count = N
return values return values
def _Export(self,df) : def _Export(self,df) :