Skip to content

Commit

Permalink
Merge pull request #151 from PriorLabs/fix_fp_feature
Browse files Browse the repository at this point in the history
fix: make fingerprint feature deterministic
  • Loading branch information
LennartPurucker authored Jan 22, 2025
2 parents c895961 + 3f97bfe commit aadaf75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tabpfn/model/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import hashlib
import warnings
from abc import abstractmethod
from collections import UserList
Expand Down Expand Up @@ -474,8 +475,7 @@ def _transform(self, X: np.ndarray, *, is_test: bool = False) -> np.ndarray:


def float_hash_arr(arr: np.ndarray) -> float:
b = arr.tobytes()
_hash = hash(b)
_hash = int(hashlib.sha256(arr.tobytes()).hexdigest(), 16)
return _hash % _CONSTANT / _CONSTANT


Expand Down

0 comments on commit aadaf75

Please sign in to comment.