Пример #1
0
 def __jug_hash__(self):
     # jug.hash is only available in jug 0.9
     # This is also the first version that would call __jug_hash__
     # So, we import it here only.
     from jug import hash
     M = hash.new_hash_object()
     hash.hash_update(M,[
         ('type', 'milk.nfoldcrossvalidation'),
         ('features', self.features),
         ('labels', self.labels),
         ('kwargs', self.kwargs),
         ])
     return M.hexdigest()
Пример #2
0
    def __jug_hash__(self):
        # jug.hash is only available in jug 0.8
        # This is also the first version that would call __jug_hash__
        # So, we import it here only.
        from jug import hash

        M = hash.new_hash_object()
        hash.hash_update(
            M,
            [
                ("type", "milk.nfoldcrossvalidation"),
                ("features", self.features),
                ("labels", self.labels),
                ("kwargs", self.kwargs),
            ],
        )
        hexdigest = M.hexdigest()
        self.__jug_hash__ = lambda: hexdigest
        return hexdigest
Пример #3
0
def _hash_simple(obj):
    return hash_update(new_hash_object(), [(0,obj)]).hexdigest()