return self.name
def __hash__(self):
return int( self.y[:100].sum() + self.X[:100,0].sum() )
def __eq__(self, other):
// use != instead of == because it is more efficient for sparse matrices:
x_eq = not(self.X != other.X).any()
After Change
def __hash__(self):
h = hashlib.md5()
for arr in [self.X, self.y, self.query_ids]:
h.update(arr)
return int(h.hexdigest(), 16)
def __eq__(self, other):
// use != instead of == because it is more efficient for sparse matrices:
x_eq = not(self.X != other.X).any()