Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tqtg committed Mar 21, 2019
1 parent bf5a444 commit fcc5bfd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ python3 setup.py install

Additional dependencies required by models are listed [here](cornac/models/README.md).

Some of the algorithms use `OpenMP` to speed up training with multithreading. For OSX users, in order to run those algorithms efficiently, you might need to install `gcc` from Homebrew to have an OpenMP compiler and install Cornac from source:
Some of the algorithms use `OpenMP` to speed up training with multithreading. For OSX users, in order to run those algorithms efficiently, you might need to install `gcc` from Homebrew to have an OpenMP compiler, and install Cornac from the source:

```sh
brew install gcc | brew link gcc
Expand All @@ -74,27 +74,31 @@ If you want to utilize your GPUs, you might consider:
This example will show you how to run your very first experiment.

- Load the [MovieLens 100K](https://grouplens.org/datasets/movielens/100k/) dataset (will be automatically downloaded if not cached).

```python
from cornac.datasets import movielens

ml_100k = movielens.load_100k()
```

- Instantiate an evaluation method. Here we split the data based on ratio.

```python
from cornac.eval_methods import RatioSplit

ratio_split = RatioSplit(data=ml_100k, test_size=0.2, rating_threshold=4.0, exclude_unknowns=False)
```

- Instantiate models that we want to evaluate. Here we use `Probabilistic Matrix Factorization (PMF)` as an example.

```python
import cornac

pmf = cornac.models.PMF(k=10, max_iter=100, learning_rate=0.001, lamda=0.001)
```

- Instantiate evaluation metrics.

```python
mae = cornac.metrics.MAE()
rmse = cornac.metrics.RMSE()
Expand All @@ -103,6 +107,7 @@ pre_20 = cornac.metrics.Precision(k=20)
```

- Instantiate and then run an experiment.

```python
exp = cornac.Experiment(eval_method=ratio_split,
models=[pmf],
Expand Down

0 comments on commit fcc5bfd

Please sign in to comment.