捷徑

torcharrow.functional.sigrid_hash

torcharrow.functional.sigrid_hash(value_col: NumericalColumn, salt: int, max_value: int)

將雜湊函數應用於索引或索引列表。這是推薦系統領域中常見的操作,以便為縮減的嵌入表提供有效的輸入。

參數:
  • value_col (定義索引的數值欄位) –

  • salt (用於初始化隨機雜湊過程的值) –

  • max_value (值將在 [0, max_value) 範圍內雜湊) –

範例

>>> import torcharrow as ta
>>> from torcharrow import functional
>>> a = ta.column([1, 2, 3, 5, 8, 10, 11])
>>> functional.sigrid_hash(a, 0, 100)
0  60
1  54
2  54
3   4
4  67
5   2
6  25
dtype: Int64(nullable=True), length: 7, null_count: 0

文件

瀏覽 PyTorch 完整的開發者文件

查看文件

教學課程

取得適用於初學者和進階開發者的深入教學課程

查看教學課程

資源

尋找開發資源並獲得解答

查看資源