创建我的 node2vec 模型后卡在我的 SVM 中

stuck in feeding my SVM after creating my node2vec model

我正在尝试使用 Node2Vec 和 SVM 在从蛋白质-蛋白质相互作用获得的图表上进行节点分类,以预测与特定疾病相关的疾病基因。准确地说。关键是,我使用 networkx 创建了一个图,我的节点具有 labels(蛋白质名称)和属性=0/1(如果该蛋白质是否引起疾病)。我在此图上应用了 node2vec,并且有了我的模型。 (在这个阶段我不关心 p 和 q 的值)但我不知道如何继续并将它提供给 SVM 或更重要的是,如何在将它提供给 SVM 之前减少我的矢量图的维度。另外,我不知道这些向量中是否包含我的节点的属性。但是,我有一个名为 lbls 的字典,其中包含我的节点及其值 这是一小段代码

node2vec = Node2Vec(G, dimensions=512, workers=4,p=1,q=2)
model = node2vec.fit(window=10, min_count=1, batch_words=4)

node2vec是一种无监督的节点嵌入方法,它基于Word2Vec。查看关于节点嵌入的 snap documentation for a brief description of the model. It will not use any of your attributes/features to create the embedding. It uses a shallow encoding, which are directly learned using a random walk based objective function. For details look at the paper or check the Stanford Lecture,其中详细介绍了 Node2Vec。您的嵌入维度当前为 512(对于 node2vec 的节点嵌入),您可能可以减少它。