List of usage examples for org.apache.mahout.cf.taste.impl.model.file FileIDMigrator FileIDMigrator
public FileIDMigrator(File dataFile) throws FileNotFoundException
From source file:io.ssc.musicwithtaste.examples.RunDiscoverNewArtistsExample.java
License:Apache License
public static void main(String[] args) throws Exception { if (args.length != 1) { System.err.println("no dataset directory supplied!"); return;//from w w w . ja v a 2 s. com } String directory = args[0]; DataModel dataModel = new FileDataModel(new File(directory, "lastfm-ratings.csv")); IDMigrator migrator = new FileIDMigrator(new File(directory, "lastfm-artists.csv")); DiscoverNewArtistsRecommender recommender = new DiscoverNewArtistsWithTaste(dataModel, migrator); String[] users = new String[] { "fdf091277a54083fe050047c8aa09fdb42cbad57", "249f277ffaac044259ac551cacea304382ec688d", "e536a743bb1dd9644e3a00b8e621359272f81567", "1e506941da0035cdfe9421b6f1a9b0eb86f51b03" }; for (String user : users) { printDiscoverNewArtists(recommender, user); } }
From source file:io.ssc.musicwithtaste.examples.RunSimilarArtistsExample.java
License:Apache License
public static void main(String[] args) throws Exception { if (args.length != 1) { System.err.println("no dataset directory supplied!"); return;/*from w w w .j a va2 s .co m*/ } String directory = args[0]; DataModel dataModel = new FileDataModel(new File(directory, "lastfm-ratings-sample-10-percent.csv")); IDMigrator migrator = new FileIDMigrator(new File(directory, "lastfm-artists.csv")); SimilarArtistsRecommender recommender = new SimilarArtistsWithTaste(dataModel, migrator); printPeopleWhoListenToThisArtistAlsoListenTo(recommender, "die rzte"); printPeopleWhoListenToThisArtistAlsoListenTo(recommender, "minor threat"); printPeopleWhoListenToThisArtistAlsoListenTo(recommender, "hansi hinterseer"); printPeopleWhoListenToThisArtistAlsoListenTo(recommender, "britney spears"); }