Crates.io | disco-cli |
lib.rs | disco-cli |
version | 0.1.2 |
source | src |
created_at | 2021-12-01 09:22:58.936317 |
updated_at | 2024-07-04 18:39:38.835768 |
description | Generate recommendations from CSV files |
homepage | |
repository | https://github.com/ankane/disco-cli |
max_upload_size | |
id | 490165 |
size | 53,547 |
:fire: Generate recommendations from CSV files
Also available for Rust and Ruby
Download the latest version:
You can also install it with Homebrew:
brew install ankane/brew/disco
or Cargo:
cargo install disco-cli
Download the MovieLens 100k dataset and generate item-based recommendations
disco download movielens-100k
disco item-recs movielens-100k.csv output.csv --factors 20
grep "^Star Wars" output.csv
Create a CSV file with your data. If users rate items directly, this is known as explicit feedback. The CSV should have three columns: user_id
, item_id
, and rating
.
user_id,item_id,rating
1,post1,5
1,post2,3.5
2,post1,4
If users don’t rate items directly (for instance, they’re purchasing items or reading posts), this is known as implicit feedback. Use value
instead of rating
and a value like number of purchases, number of page views, or just 1
.
user_id,item_id,value
1,post1,1
1,post2,1
2,post1,1
Each user_id
/item_id
combination should only appear once.
Generate user-based recommendations - “users like you also liked”
disco user-recs data.csv output.csv
This creates a CSV with user_id
, recommended_item_id
, and score
columns.
Generate item-based recommendations - “users who liked this item also liked”
disco item-recs data.csv output.csv
This creates a CSV with item_id
, recommended_item_id
, and score
columns.
Generate similar users
disco similar-users data.csv output.csv
This creates a CSV with user_id
, similar_user_id
, and score
columns.
Disco uses high-performance matrix factorization.
Specify the number of factors and iterations
disco ... --factors 8 --iterations 20
Specify the number of recommendations for each user or item
disco ... --count 10
Download a dataset
disco download movielens-100k
Supported datasets are:
View the changelog
Everyone is encouraged to help improve this project. Here are a few ways you can help:
To get started with development:
git clone https://github.com/ankane/disco-cli.git
cd disco-cli
cargo run