forked from KarypisLab/METIS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
1 addition
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,92 +80,6 @@ directories, respectively. | |
Performs clean and completely removes the build directory. | ||
|
||
|
||
<!--- | ||
## Getting started | ||
Here are some examples to quickly try out SLIM on the sample datasets that are provided with SLIM. | ||
### Python interface | ||
```python | ||
import pandas as pd | ||
from SLIM import SLIM, SLIMatrix | ||
#read training data stored as triplets <user> <item> <rating> | ||
traindata = pd.read_csv('../test/AutomotiveTrain.ijv', delimiter = ' ', header=None) | ||
trainmat = SLIMatrix(traindata) | ||
#set up parameters to learn model, e.g., use Coordinate Descent with L1 and L2 | ||
#regularization | ||
params = {'algo':'cd', 'nthreads':2, 'l1r':1.0, 'l2r':1.0} | ||
#learn the model using training data and desired parameters | ||
model = SLIM() | ||
model.train(params, trainmat) | ||
#read test data having candidate items for users | ||
testdata = pd.read_csv('../test/AutomotiveTest.ijv', delimiter = ' ', header=None) | ||
#NOTE: model object is passed as an argument while generating test matrix | ||
testmat = SLIMatrix(testdata, model) | ||
#generate top-10 recommendations | ||
prediction_res = model.predict(testmat, nrcmds=10, outfile = 'output.txt') | ||
#dump the model to files on disk | ||
model.save_model(modelfname='model.csr', # filename to save the model as a csr matrix | ||
mapfname='map.csr' # filename to save the item map | ||
) | ||
#load the model from from disk | ||
model_new = SLIM() | ||
model_new.load_model(modelfname='model.csr', # filename of the model | ||
mapfname='map.csr' # filename of the item map | ||
) | ||
``` | ||
The users can also refer to the python notebook [UserGuide.ipynb](./python-package/UserGuide.ipynb) located at | ||
`./python-package/UserGuide.ipynb` for more examples on using the python api. | ||
### Command-line programs | ||
SLIM can be used by running the command-line programs that are located under `./build` directory. Specifically, SLIM provides the following three command-line programs: | ||
- `slim_learn`: for estimating a model | ||
- `slim_predict`: for applying a previously estimated model, and | ||
- `slim_mselect`: for exploring a set of hyper-parameters in order to select the best performing model. | ||
Additional information about how to use these command-line programs is located in | ||
SLIM's reference manual that is available at | ||
[./doxygen/html/index.html](http://glaros.dtc.umn.edu/gkhome/files/fs/sw/slim/doc/html/index.html) | ||
or | ||
[./doxygen/latex/refman.pdf](http://glaros.dtc.umn.edu/gkhome/files/fs/sw/slim/doc/refman.pdf). | ||
### Library interface | ||
You can also use SLIM by direclty linking into your C/C++ program via its library interface. SLIM's API is described | ||
in SLIM's reference manual (see links above). | ||
## Citing | ||
If you use any part of this library in your research, please cite it using the | ||
following BibTex entry: | ||
``` | ||
@online{slim, | ||
title = {{SLIM Library for Recommender Systems}}, | ||
author = {Ning, Xia and Nikolakopoulos, Athanasios N. and Shui, Zeren and Sharma, Mohit and Karypis, George}, | ||
url = {https://github.com/KarypisLab/SLIM}, | ||
year = {2019}, | ||
} | ||
``` | ||
## References | ||
1. [Slim: Sparse linear methods for top-n recommender systems](http://glaros.dtc.umn.edu/gkhome/node/774) | ||
## Credits & Contact Information | ||
This implementation of SLIM was written by George Karypis with contributions by Xia Ning, Athanasios N. Nikolakopoulos, Zeren Shui and Mohit Sharma. | ||
If you encounter any problems or have any suggestions, please contact George Karypis at <a href="mailto:[email protected]">[email protected]</a>. | ||
--> | ||
|
||
## Copyright & License Notice | ||
Copyright 1998-2020, Regents of the University of Minnesota | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters