La interfaz está localizada; las descripciones y documentos de las Skills se traducen automáticamente con IA a su idioma. El código, los comandos, rutas y términos técnicos se mantienen en el original, y prevalece el documento del autor.
Explorar Skills
Productividad · SKILL.md

link-prediction-kg

link-prediction-kg

Guides StellarGraph link prediction, link regression, edge splitting, temporal link workflows, and knowledge graph completion with ComplEx, DistMult, RotatE, RotE, and RotH.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentación de la Skill

GitHub

name: link-prediction-kg description: "Guides StellarGraph link prediction, link regression, edge splitting, temporal link workflows, and knowledge graph completion with ComplEx, DistMult, RotatE, RotE, and RotH." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

Link Prediction and Knowledge Graphs

Use this sub-skill when a StellarGraph task predicts edges/ratings/relations, performs link regression/classification, splits graph edges into train/test sets, or scores triples in a knowledge graph.

Read first

Route here when the user asks to

  • use EdgeSplitter.train_test_split;
  • build link prediction with GraphSAGELinkGenerator, HinSAGELinkGenerator, FullBatchLinkGenerator, Attri2VecLinkGenerator, or Node2VecLinkGenerator;
  • add link_classification, link_regression, or link_inference to source and destination node embeddings;
  • perform knowledge graph completion with KGTripleGenerator, ComplEx, DistMult, RotatE, RotE, or RotH;
  • use SelfAdversarialNegativeSampling or rank triples against all nodes;
  • adapt CTDNE or temporal link-prediction workflows.

Route elsewhere

Operating workflow

  1. Construct a graph with valid node IDs, edge IDs/types, and features required by the chosen embedding model.
  2. Split edges for evaluation with EdgeSplitter or an equivalent leakage-safe method. Keep train and test positives/negatives separate.
  3. Choose a link generator:
    • GCN/GAT/PPNP-style full-batch embeddings: FullBatchLinkGenerator;
    • GraphSAGE: GraphSAGELinkGenerator;
    • HinSAGE: HinSAGELinkGenerator with head node types;
    • Attri2Vec/Node2Vec link heads: matching link generators;
    • knowledge graph completion: KGTripleGenerator.
  4. Build the base embedding model and call in_out_tensors().
  5. Attach a link head such as link_classification, link_regression, or link_inference to combine source/destination embeddings.
  6. Compile and train/evaluate with generator flow(link_ids, targets, ...).
  7. For knowledge graph models, use negative sampling and ranking routines designed for triples rather than ordinary binary edge pairs.

Safe check

python sub-skills/link-prediction-kg/scripts/link_prediction_smoke.py --help
python sub-skills/link-prediction-kg/scripts/link_prediction_smoke.py

The smoke uses a tiny graph and does not download datasets or train a notebook.

Skills guardadas