This program is customized by Command Line (cli) and Configuration files.
The following command line parameters are available:
[-cv <arg>] [-d <arg>] [-r <arg>] [-s]
More precisely,
-h
: print help information.-cv
: The number of folds for cross validation, default: 5.-d
or--dataset
: The dataset(s) to be processed, valid options are based on configuration file "default.properties".-r
or--recommender
: The recommender(s) to be applied, valid options are based on configuration file "default.properties".-s
or--split
: Whether to re-split the dataset, default: false.
For example, if you'd like to test user-based kNN
and item-based kNN
algorithms on datasets ml-100k
and ml-1m
, the folds of Cross Validation is 6, the command would be:
java -jar lib-rec-app.jar -d ml-100k ml-1m -r userknn itemknn -cv 6
* NB: The abbreviations of algorithms are based on Librec project, available at: AlgorithmList.
The detailed configurations of this program and specific parameters of each algorithms are determined by various configuration files:
- The default configuration
- Specify the default settings such as the data directories, dataset path.
- For more details, please refer to default.properties.
- The dataset information
- Specify the input path, data format, etc.
- For more details, please refer to Dataset folder.
- NB: Will override same settings of default.properties.
- The Recommender algorithms parameters
- Specify parameters of each algorithms.
- For more details, please refer to Algorithms folder.
- NB: Will override same settings of files in Dataset folder.
- Some parameter templates are available at: Algorithms Configuration.
-
Open
Anaconda3
-->Anaconda Prompt
-
Execute the command:
conda activate py36
The cli (Command Line Interface) would show:
![conda activate py36](README/conda activate.png)
-
Use
cd
command toch
ange the current workingdir
ectory to the folder ofmain.py
cd C:\Users\hongl\OneDrive\Documents\LibRecApp
The cli would show:
-
Execute the
Python
script to generate the merged files:python main.py -d [your dataset(s)] -r [your recommender(s)] -cv [the number of cross validation]
Example:
Experiment Condition:
- Dataset:
ml-1m
- Recommender:
userknn
ใitemknn
- CV:
5
python main.py -d ml-1m -r userknn itemknn -cv 5
The cli would show:
Note:
To get simple prompt usage:
python main.py -h
The cli would show:
- Dataset:
-
Output file name:
.../result/<dataset>/merge_[<recommender name>]/cv_<cv>_<timestamp>.csv
A very useful simple-doc for UNIX introduction is available at: UNIX Survival Guide. (The cheat sheet at Page 30)
Please read carefully from Page 10 to Page 16. (Very easy to understand, I promise :)
Some times you may want to do something else and leave the server running at background. The screen
command would be very useful.
Here is a simple introduction of screen.
You may use:
screen -ls
To list all sessions (attached and detached).
Example:
screen -r <Session name> (for example: screen -r 47647)
To resume (move to) certain screen. For convenience, you can type screen -r 4
as only one session name starts with "4". If you want to resume session "31185", you can type screen -r 311
at least, as there is another session named "31069".
Ctrl
-A
+ Ctrl
-D
To detach the current and return to parent session.
Example:
exit
Close current session, can be used on main session and any sub sessions.