そもそもテキスト埋め込みベクトルの分布の形状はどのようなものか
データはXから取得した18129件からTalk to the Cityのextructionで抽出されたargument 7574件
text-embedding-3-largeで3072次元のベクトル空間に埋め込んでいるOpenAIが返す埋め込みベクトルは正規化されているので全てのベクトルの長さは1である
def p(x):
print(f"{x.mean()} ± {x.std() * 3}")
norm = np.linalg.norm(embeddings_array, axis=1)
p(norm) # -> 0.999999999999999 ± 1.2314317043463034e-15
各軸の値はSD 0.01程度の狭い範囲に集まっている py
axis_std = embeddings_array.std(axis=0)
pd.DataFrame(axis_std).describe()
3072次元のうち80次元が6割の情報を持っている
各データの他のデータに対する内積は0.4あたりを平均として0.1~0.7程度
eps float, default=0.5
The maximum distance between two samples for one to be considered as in the neighborhood of the other.
HDBSCANのcondensed_tree_.plot