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 84bde25 commit b4fb862
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@

Currently, we are supporting Python 3 (version 3.6 is recommended). There are several ways to install Cornac:

- **From PyPI (you may need a C++ compiler):**
- **From PyPI (you may need a C++ compiler):**

```sh
pip3 install cornac
```

- **From Anaconda:**
- **From Anaconda:**

```sh
conda install cornac -c qttruong -c pytorch
```

- **From the GitHub source (for latest updates):**
- **From the GitHub source (for latest updates):**

```sh
pip3 install Cython
Expand All @@ -62,9 +62,9 @@ brew install gcc | brew link gcc

If you want to utilize your GPUs, you might consider:

- [TensorFlow installation instructions](https://www.tensorflow.org/install/).
- [PyTorch installation instructions](https://pytorch.org/get-started/locally/).
- [cuDNN](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/) (for Nvidia GPUs).
- [TensorFlow installation instructions](https://www.tensorflow.org/install/).
- [PyTorch installation instructions](https://pytorch.org/get-started/locally/).
- [cuDNN](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/) (for Nvidia GPUs).

## Getting started: your first Cornac experiment

Expand All @@ -73,36 +73,36 @@ 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).
- 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.
- 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.
- 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.
- Instantiate evaluation metrics.
```python
mae = cornac.metrics.MAE()
rmse = cornac.metrics.RMSE()
rec_20 = cornac.metrics.Recall(k=20)
pre_20 = cornac.metrics.Precision(k=20)
```

- Instantiate and then run an experiment.
- Instantiate and then run an experiment.
```python
exp = cornac.Experiment(eval_method=ratio_split,
models=[pmf],
Expand All @@ -127,8 +127,8 @@ The recommender models supported by Cornac are listed [here](cornac/models/READM
## Support

Your contributions at any level of the library are welcome. If you intend to contribute, please:
- Fork the Cornac repository to your own account.
- Make changes and create pull requests.
- Fork the Cornac repository to your own account.
- Make changes and create pull requests.

You can also post bug reports and feature requests in [GitHub issues](https://github.com/PreferredAI/cornac/issues).

Expand Down

0 comments on commit b4fb862

Please sign in to comment.