Implements Selective Preference Aggregation (SPA), a rank aggregation framework that constructs collective rankings while limiting the fraction of individual preferences that can be overruled.
Project description
SPA
Selective Preference Aggregation
├── data # processed datasets `data_dir`
├── spa # source code `pkg_dir`
├── scripts # scripts that run source code
├── results # results `results_dir`
├── reporting # source code for reporting
├── reports # reports `reports_dir`
1. Add Your Dataset
-
Location: Create a subfolder for your dataset within the
data/directory (e.g.,data/movie/). -
File Naming: Place your data file(s) in this subfolder, named according to the pattern:
{dataset_name}_{type}.csv(e.g.,movie_ratings.csv,movie_pairwise.csv). -
Data Format: Ensure your CSV file matches one of the following structures based on the
{type}in your filename:-
For
rankingorratingtypes:- Headers (First Row): User ids.
- First Column: Item ids.
- Cell A1 (Top-Left): Must contain the exact text
item_name. - Data Cells: Preference values (rating or rank) given by the user (column) for the item (row)
Example (
movie_ratings.csv):item_name,user101,user102,user103 ItemA,5,4,3 ItemB,3,4,5 ItemC,2,1,4 ItemD,1,2,2
-
For
pairwisecomparison types:- Headers (First Row): Must be exactly
judge_id,item_id_1,item_id_2,pref. - Rows: Each row represents a single comparison made by a
judge_id. prefColumn: Indicates the user preference:1:item_id_1is preferred overitem_id_2.-1:item_id_2is preferred overitem_id_1.0: Represents a tie or indifference.
Example (
movie_pairwise.csv):judge_id,item_id_1,item_id_2,pref judgeA,itemX,itemY,1 judgeA,itemY,itemZ,-1 judgeB,itemX,itemY,0 judgeB,itemX,itemZ,1 judgeC,itemY,itemZ,1
- Headers (First Row): Must be exactly
-
2. Configure and Run Experiments
-
Update Dataset Creation Script:
- Open the file
scripts/create_datasets.py. - Find the
settingsdictionary. - Add the
{dataset_name}string (e.g.,"movie") from Step 1 to thedata_nameslist.settings = { "data_names": ["movie"], ... }
- Execute the script
- Open the file
-
Update Main Experiment Script:
- Open the file
scripts/dev_spa.py. - Find the
settingsdictionary within this script. - Add the same
{dataset_name}string to thedata_nameslist (or similar configuration entry) in this file as well.settings = { "data_names": ["movie"], # Added "movie" "seed": 2338, ... }
- Execute dev_spa.py
- Open the file
3. Generating and Viewing Results
-
Aggregate Base Results:
- Configure settings within
scripts/aggregate_base_results.py. - Execute the script .
- Configure settings within
-
Combine All Results:
- Configure settings within
scripts/combine_all_results.py. - Execute the script.
- Configure settings within
-
Locate Output CSV:
- The final, combined results are saved as a CSV file within the
results/directory (results_dir). - The filename includes a timestamp for uniqueness.
- The final, combined results are saved as a CSV file within the
-
(Optional) Generate LaTeX Table:
- Modify and run the R script located at
scripts/create_big_table.R. Update the script to point to the correct input CSV file from the previous step. - This will output a
.texfile.
- Modify and run the R script located at
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file selectiverank-0.0.1.tar.gz.
File metadata
- Download URL: selectiverank-0.0.1.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e07be6708e13a62a782b4b54f613e8c3e3133fc08452ec2cf7bca92cc096859
|
|
| MD5 |
b1f3b237064e98393e9a762a016e97cd
|
|
| BLAKE2b-256 |
d1ba94d82c865d93de43b058cdecd0cfcb9f1ce1aa963f6febd63e6d2a7a3f92
|
File details
Details for the file selectiverank-0.0.1-py3-none-any.whl.
File metadata
- Download URL: selectiverank-0.0.1-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4732fb86ab59d9f510cdaf2613155fa1f2b1df7d30e45c1436da89e17578e9ac
|
|
| MD5 |
2596dc41b6ae2bf698c1825f87dd0b1c
|
|
| BLAKE2b-256 |
669788d0b5c78f2c6765adf81109f87306d8355f73b1227732d5601333694384
|