alteryx / alteryx/woodwork

Define `Embedding` logical type for vector data

オープン
#1,871 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
155
フォーク
24
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi,

I am wondering if it's possible to add self-defined Embedding logical type into ww which represents vector data? I tried with below code but failed.

```
import pandas as pd
import numpy as np
import woodwork as ww
from woodwork.logical_types import LogicalType

class Embedding(LogicalType):
primary_dtype = 'object'
standard_tags = {'embedding', 'numeric'}

ww.type_system.add_type(Embedding)

df = pd.DataFrame(
{
"id": [0, 1, 2, 3],
"code": ["012345412359", "122345712358", "012345412359", "012345412359"],
'embedding_0': [np.array([1, 2, 3]), np.array([2, 3, 4]), np.array([3, 4, 5]), np.array([4, 5, 6])],
'embedding_1': [[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6]],
}
)

with ww.config.with_options():
df.ww.init()
df.ww
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。