Skip to content

Commit

Permalink
Revamp Documentation (#541)
Browse files Browse the repository at this point in the history
* updated sphinx version and theme

* WIP

* Updated docs

* Updated index

* wip

* Updated quickstart docs

* WIP

* WIP

* Added different sections

* Changes to indexes

* added example to index

* Update requirements.txt

* WIP

* WIP

* WIP

* WIP

* Updated researcher doc

* WIP

* Update index.rst

* Should work with other versions, just that we don't build wheels

* Update quickstart guide

* Update developer guide

* Update researcher guide

* Update developer guide

* fixed step numbering

* add announcement to docs

* Updated styling

* separate announcement from conf file

* Styling changes

* Updated install guide

* Update docs

* remove pypi from docs

* Updated foodrecce example

* Updated guides and index

* update api reference

* Update install

* Update docs

* clean up

* Change api and contributors guide order

* shortened official site label

* Updated developer guide

* Lightened dark primary color

* Added tutorials, examples links to github repo

* clean up

* clean up

* clean up

* Remove duplicate index

* re-organize hyperopt

* minor changes

* update install from github source

* revise quickstart

* update install from source

* revise developer guide

* minor changes

* revise researcher guide

* minor changes

* revise foodrecce example

* minor changes

* Add link to GitHub

---------

Co-authored-by: tqtg <tuantq.vnu@gmail.com>
  • Loading branch information
darrylong and tqtg authored Nov 20, 2023
1 parent 1eadb83 commit 8a28d75
Show file tree
Hide file tree
Showing 34 changed files with 3,253 additions and 237 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

Currently, we are supporting Python 3. There are several ways to install Cornac:

- **From PyPI (you may need a C++ compiler):**
- **From PyPI (recommended):**
```bash
pip3 install cornac
```
Expand All @@ -48,10 +48,7 @@ Currently, we are supporting Python 3. There are several ways to install Cornac:

- **From the GitHub source (for latest updates):**
```bash
pip3 install Cython numpy scipy
git clone https://github.com/PreferredAI/cornac.git
cd cornac
python3 setup.py install
pip3 install git+https://github.com/PreferredAI/cornac.git
```

**Note:**
Expand Down
6 changes: 3 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = Cornac
SOURCEDIR = source
BUILDDIR = build

Expand All @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
4 changes: 4 additions & 0 deletions docs/announcement.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
Welcome to our new documentation site! Please report any issues
<a href='https://github.com/PreferredAI/cornac/issues/new?title=%5BDOCS%5D'>here</a>.
</div>
15 changes: 7 additions & 8 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=Cornac

if "%1" == "" goto help
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
Expand All @@ -22,15 +19,17 @@ if errorlevel 9009 (
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
echo.https://www.sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Cython>=3.0.5
numpy>=1.26.1
scipy>=1.11.3
sphinx-rtd-theme>=1.3.0
pydata-sphinx-theme>=0.14.1
24 changes: 24 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
html[data-theme="light"] {
--pst-color-primary: #A3361F;
--pst-color-secondary: #BE181E;
--pst-color-primary-bg: #95736d;
--pst-color-secondary-bg: #94dfff;
--pst-color-inline-code-links: #1F70A3;
}

html[data-theme="dark"] {
--pst-color-primary: #c15f63;
--pst-color-secondary: #18BEB8;
--pst-color-primary-bg: #95736d;
--pst-color-secondary-bg: #0082ba;
--pst-color-inline-code-links: #c4c8ff;
}

html {
--pst-font-size-h1: 2.5rem;
--pst-font-size-h2: 1.8rem;
--pst-font-size-h3: 1.3rem;
--pst-font-size-h4: 1.2rem;
--pst-font-size-h5: 1.1rem;
--pst-font-size-h6: 1.05rem;
}
Binary file added docs/source/_static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/source/_static/switcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"name": "dev",
"version": "1.17",
"url": "https://cornac.readthedocs.io/1.17/"
}
]
3 changes: 0 additions & 3 deletions docs/source/data.rst → docs/source/api_ref/data.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
Data
====


.. automodule:: cornac.data
:members:

Dataset
------------------------------------
Expand Down
20 changes: 10 additions & 10 deletions docs/source/datasets.rst → docs/source/api_ref/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,52 @@ Built-in Datasets
:members:

Amazon Clothing
-----------------------------------------------
---------------
.. automodule:: cornac.datasets.amazon_clothing
:members:

Amazon Digital Music
-----------------------------------------------
--------------------
.. automodule:: cornac.datasets.amazon_digital_music
:members:

Amazon Office
---------------------------------------------
-------------
.. automodule:: cornac.datasets.amazon_office
:members:

Amazon Toys and Games
---------------------------------------------
---------------------
.. automodule:: cornac.datasets.amazon_toy
:members:

CiteULike
-----------------------------------------
---------
.. automodule:: cornac.datasets.citeulike
:members:

Epinions
-----------------------------------------
--------
.. automodule:: cornac.datasets.epinions
:members:

FilmTrust
---------------------------------------------
---------
.. automodule:: cornac.datasets.filmtrust
:members:

MovieLens
-----------------------------------------
---------
.. automodule:: cornac.datasets.movielens
:members:

Netflix
---------------------------------------
-------
.. automodule:: cornac.datasets.netflix
:members:

Tradesy
---------------------------------------
-------
.. automodule:: cornac.datasets.tradesy
:members:

Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
Evaluation Methods
======================
==================

.. automodule:: cornac.eval_methods

Base Method
-----------------------------------------------
-----------
.. automodule:: cornac.eval_methods.base_method
:members:

Cross Validation
----------------------------------------------------
----------------
.. automodule:: cornac.eval_methods.cross_validation
:members:

Propensity Stratified Evaluation
--------------------------------------------------------------------
--------------------------------
.. automodule:: cornac.eval_methods.propensity_stratified_evaluation
:members:

Ratio Split
-----------------------------------------------
-----------
.. automodule:: cornac.eval_methods.ratio_split
:members:

Stratified Split
----------------------------------------------------
----------------
.. automodule:: cornac.eval_methods.stratified_split
:members:
:members:
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ Experiment
.. automodule:: cornac.experiment

Experiment
--------------------------------------------
----------
.. automodule:: cornac.experiment.experiment
:members:

Result
----------------------------------------
------
.. automodule:: cornac.experiment.result
:members: Result

CVResult
----------------------------------------
--------
.. automodule:: cornac.experiment.result
:members: CVResult

ExperimentResult
----------------------------------------
----------------
.. automodule:: cornac.experiment.result
:members: ExperimentResult

CVExperimentResult
----------------------------------------
------------------
.. automodule:: cornac.experiment.result
:members: CVExperimentResult
18 changes: 18 additions & 0 deletions docs/source/api_ref/hyperopt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Hyper-parameter Tuning
======================


Grid Search
---------------
.. automodule:: cornac.hyperopt
:members: GridSearch

Random Search
--------------------
.. automodule:: cornac.hyperopt
:members: RandomSearch

Search Domain
---------------
.. automodule:: cornac.hyperopt
:members: Discrete, Continuous
17 changes: 17 additions & 0 deletions docs/source/api_ref/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
API Reference
=============

Welcome to the API Reference. This section contains the documentation of the
functions and classes of the ``cornac`` package.

.. toctree::
:maxdepth: 2
:caption: API Reference

data
models
metrics
eval_methods
experiment
datasets
hyperopt
16 changes: 8 additions & 8 deletions docs/source/metrics.rst → docs/source/api_ref/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Rating
++++++

Mean Absolute Error (MAE)
----------------------------
-------------------------
.. autoclass:: MAE

Mean Squared Error (MSE)
------------------------
.. autoclass:: MSE

Root Mean Squared Error (RMSE)
--------------------------------
------------------------------
.. autoclass:: RMSE

+++++++
Expand All @@ -28,29 +28,29 @@ Area Under the Curve (AUC)
.. autoclass:: AUC

Fmeasure (F1)
-------------------
-------------
.. autoclass:: FMeasure

Mean Average Precision (MAP)
----------------------------
.. autoclass:: MAP

Mean Reciprocal Rank (MRR)
-------------------------------------------
--------------------------
.. autoclass:: MRR

Normalized Cumulative Reciprocal Rank (NCRR)
--------------------------------------------
.. autoclass:: NCRR

Normalized Discount Cumulative Gain (NDCG)
-------------------------------------------
------------------------------------------
.. autoclass:: NDCG

Precision
-------------------
---------
.. autoclass:: Precision

Recall
-------------------
.. autoclass:: Recall
------
.. autoclass:: Recall
Loading

0 comments on commit 8a28d75

Please sign in to comment.