BlogDataset(root, name, transform=None, pre_transform=None, pre_filter=None)
Bases: InMemoryDataset
Blog network dataset loader for graph-based analysis.
| Parameters: |
|
|---|
Notes
Dataset Structure:
- Nodes represent blogs
- Edges represent connections between blogs
- Node features from blog attributes
- Labels indicate blog categories
- Includes train/val/test splits (80/10/10)
processed_file_names
property
Names of processed data files.
| Returns: |
|
|---|
Notes
Processed files:
- data.pt: Contains processed PyTorch Geometric data object
raw_file_names
property
Names of required raw files.
| Returns: |
|
|---|
Notes
Required files:
- data.mat: MATLAB file containing network data, attributes, and groups
download()
Download raw data files.
Notes
Empty implementation - data should be manually placed in raw directory
load_dataset()
Load raw MATLAB dataset file.
| Returns: |
|
|---|
Notes
- Loads .mat file containing network structure
- Extracts attributes, network, and group information
- Converts one-hot labels to class indices
process()
Process raw data into PyTorch Geometric Data format.
Notes
-
Load MATLAB data:
- Node attributes
- Adjacency matrix
- Group labels
-
Convert to PyTorch format:
- Edge indices from sparse adjacency
- Float features from attributes
- Integer labels from groups
-
Create Data object with:
- Edge indices
- Node features
- Node labels
- Train/val/test masks
-
Apply pre-transform if specified
- Save processed data
Data Split:
- Training: 80%
- Validation: 10%
- Testing: 10%
Features:
- Sparse matrix conversion
- Type casting
- Random split generation
- Optional pre-transform support