How hypernetwork-research-group/hypernegative works
Project type and purpose
• This is a Python library (“hypernegative”) for evaluating Hyperlink Prediction (HLP) algorithms with pluggable Negative Sampling (NS) methods.
• It exposes both a CLI (e.g. imdb_pipeline) and a Python API (DatasetLoader, HLP algorithms, NS algorithms).
Main components (to become “packages”
1. hyperlink_prediction
• datasets (ARB, IMDB, generic Hypergraph)
• loader (DatasetLoader)
• core classes: HyperlinkPredictionAlgorithm, HyperlinkPredictionBase, HyperlinkPredictionResult
2. negative_sampling
• HypergraphNegativeSamplingAlgorithm, result classes
3. pipelines
• CLI entrypoints (e.g. imdb_pipeline) that orchestrate dataset loading, negative sampling, HLP execution
4. utils
• data‐splitting, method‐selector helpers
5. External Dependencies
• PyTorch
• PyTorch Geometric
Relationships and data flow
• pipelines → invoke DatasetLoader (from hyperlink_prediction.loader)
• DatasetLoader → pulls raw data from hyperlink_prediction.datasets
• pipelines → use a NegativeSampler (from negative_sampling) to generate negative edges
• pipelines → feed positive + negative samples to a HyperlinkPredictionAlgorithm
• HyperlinkPredictionAlgorithm → emits HyperlinkPredictionResult
• utils support HLP and NS via helper functions
Architectural patterns and design principles
• Modular, layered pipeline: clear separation of data ingestion, negative sampling, prediction, and result reporting
• “Plug‐and‐play” strategy pattern: HLP methods and NS strategies implement common base interfaces
• CLI as a thin orchestration layer over core library
5. Hierarchically: pipelines → loader/datasets/ns → hlp core → results, with utils/helpers alongside.
6. External dependencies to the periphery.
This will yield a clean, accurate representation of Hypernegative’s architecture, highlighting modularity, extensibility points, and the core pipeline.