-
Notifications
You must be signed in to change notification settings - Fork 2
/
Driver.java
53 lines (43 loc) · 2.09 KB
/
Driver.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import org.apache.hadoop.conf.Configuration;
public class Driver {
/***
* main method
* Input: two files, watchHistory and movieTitle
* Output will be saved in the file of recommenderResult
*
***/
public static void main(String[] args) throws Exception {
if (args.length < 9) {
new Exception("Please input: <watchHistory dir> <output1 dir> <output2 dir> <output3 dir> <output4 dir> <watchHistory dir> <movieTitles dir> <recommenderResult dir> <int k>\n");
return ;
}
Configuration conf = new Configuration();
conf.set("coOccurrencePath", args[2]);
conf.set("watchHistoryPath", args[0]);
conf.set("movieTitlesPath", args[4]);
DataDividerByUser dataDivider = new DataDividerByUser();
CoOccurenceMatrixGenetator cGenetator = new CoOccurenceMatrixGenetator();
Multiplication multiplication = new Multiplication();
RecommenderListGenerator rGenerator = new RecommenderListGenerator();
TopK_RecommenderGenerator topkGenerator = new TopK_RecommenderGenerator();
String dataDividerInput = args[0];
String dataDividerOutput = args[1];
String CoOccurenceMatrixGenetatorInput = args[1];
String CoOccurenceMatrixGenetatorOutput = args[2];
String MultiplicationInput = args[0];
String MultiplicationOutput = args[3];
String coOccurrencePath = args[2];
String RecommenderListGeneratorInput = args[3];
String RecommenderListGeneratorOutput = args[4];
String watchHistory = args[5];
String movieTitles = args[6];
String recommenderListPath = args[4];
String recommenderResultPath = args[7];
int k = Integer.parseInt(args[8]);
dataDivider.DataDividerByUser_dirver(dataDividerInput, dataDividerOutput);
cGenetator.CoOccurenceMatrixGenetator_driver(CoOccurenceMatrixGenetatorInput, CoOccurenceMatrixGenetatorOutput);
multiplication.Multiplication_dirver(MultiplicationInput, MultiplicationOutput, coOccurrencePath);
rGenerator.RecommenderListGenerator_driver(watchHistory, movieTitles, RecommenderListGeneratorInput, RecommenderListGeneratorOutput);
topkGenerator.TopK_RecommenderGenerator_driver(recommenderListPath, recommenderResultPath, k);
}
}