@@ -272,7 +272,7 @@ def dok_matrix(self):
272272 """The user-item interaction matrix in DOK sparse format"""
273273 if self .__dok_matrix is None :
274274 self .__dok_matrix = dok_matrix (
275- (self .num_users , self .num_items ), dtype = np . float32
275+ (self .num_users , self .num_items ), dtype = 'float'
276276 )
277277 for u , i , r in zip (* self .uir_tuple ):
278278 self .__dok_matrix [u , i ] = r
@@ -364,13 +364,13 @@ def build(
364364 raise ValueError ("data is empty after being filtered!" )
365365
366366 uir_tuple = (
367- np .asarray (u_indices , dtype = np . int ),
368- np .asarray (i_indices , dtype = np . int ),
369- np .asarray (r_values , dtype = np . float ),
367+ np .asarray (u_indices , dtype = ' int' ),
368+ np .asarray (i_indices , dtype = ' int' ),
369+ np .asarray (r_values , dtype = ' float' ),
370370 )
371371
372372 timestamps = (
373- np .fromiter ((int (data [i ][3 ]) for i in valid_idx ), dtype = np . int )
373+ np .fromiter ((int (data [i ][3 ]) for i in valid_idx ), dtype = ' int' )
374374 if fmt == "UIRT"
375375 else None
376376 )
@@ -447,7 +447,7 @@ def idx_iter(self, idx_range, batch_size=1, shuffle=False):
447447
448448 Returns
449449 -------
450- iterator : batch of indices (array of np. int)
450+ iterator : batch of indices (array of ' int' )
451451
452452 """
453453 indices = np .arange (idx_range )
@@ -481,8 +481,8 @@ def uir_iter(self, batch_size=1, shuffle=False, binary=False, num_zeros=0):
481481
482482 Returns
483483 -------
484- iterator : batch of users (array of np. int), batch of items (array of np. int),
485- batch of ratings (array of np. float)
484+ iterator : batch of users (array of ' int' ), batch of items (array of ' int' ),
485+ batch of ratings (array of ' float' )
486486
487487 """
488488 for batch_ids in self .idx_iter (len (self .uir_tuple [0 ]), batch_size , shuffle ):
@@ -524,8 +524,8 @@ def uij_iter(self, batch_size=1, shuffle=False, neg_sampling="uniform"):
524524
525525 Returns
526526 -------
527- iterator : batch of users (array of np. int), batch of positive items (array of np. int),
528- batch of negative items (array of np. int)
527+ iterator : batch of users (array of ' int' ), batch of positive items (array of ' int' ),
528+ batch of negative items (array of ' int' )
529529
530530 """
531531
@@ -562,9 +562,9 @@ def user_iter(self, batch_size=1, shuffle=False):
562562
563563 Returns
564564 -------
565- iterator : batch of user indices (array of np. int)
565+ iterator : batch of user indices (array of ' int' )
566566 """
567- user_indices = np .fromiter (self .user_indices , dtype = np . int )
567+ user_indices = np .fromiter (self .user_indices , dtype = ' int' )
568568 for batch_ids in self .idx_iter (len (user_indices ), batch_size , shuffle ):
569569 yield user_indices [batch_ids ]
570570
@@ -580,9 +580,9 @@ def item_iter(self, batch_size=1, shuffle=False):
580580
581581 Returns
582582 -------
583- iterator : batch of item indices (array of np. int)
583+ iterator : batch of item indices (array of ' int' )
584584 """
585- item_indices = np .fromiter (self .item_indices , np . int )
585+ item_indices = np .fromiter (self .item_indices , ' int' )
586586 for batch_ids in self .idx_iter (len (item_indices ), batch_size , shuffle ):
587587 yield item_indices [batch_ids ]
588588
0 commit comments