From f047dfb32cd74b35318082a67b6ca4cc8a4c2504 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Fri, 30 Mar 2018 14:05:23 -0400 Subject: [PATCH] Use specific Doxygen syntax types. --- doc/guide/cli_quickstart.hpp | 20 ++++++++++---------- doc/guide/python_quickstart.hpp | 24 ++++++++++++------------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/doc/guide/cli_quickstart.hpp b/doc/guide/cli_quickstart.hpp index cbdab4a00e..3ec4d40b7c 100644 --- a/doc/guide/cli_quickstart.hpp +++ b/doc/guide/cli_quickstart.hpp @@ -19,21 +19,21 @@ package manager. For instance, for Ubuntu or Debian the command is simply -@code -$ sudo apt-get install mlpack-bin +@code{.sh} +sudo apt-get install mlpack-bin @endcode On Fedora or Red Hat: -@code -$ sudo dnf install mlpack +@code{.sh} +sudo dnf install mlpack @endcode If you use a different distribution, mlpack may be packaged under a different name. And if it is not packaged, you can use a Docker image from Dockerhub: -@code -$ docker run -it mlpack/mlpack /bin/bash +@code{.sh} +docker run -it mlpack/mlpack /bin/bash @endcode This Docker image has mlpack already built and installed. @@ -50,7 +50,7 @@ finally we'll print the accuracy of the random forest on the test dataset. You can copy-paste this code directly into your shell to run it. -@code +@code{.sh} # Get the dataset and unpack it. wget http://www.mlpack.org/datasets/covertype-small.data.csv.gz wget http://www.mlpack.org/datasets/covertype-small.labels.csv.gz @@ -94,7 +94,7 @@ the test dataset (80%+). The file @c predictions.csv could also be used by other tools; for instance, we can easily calculate the number of points that were predicted incorrectly: -@code +@code{.sh} $ diff -U 0 predictions.csv covertype-test.labels.csv | grep '^@@' | wc -l @endcode @@ -144,7 +144,7 @@ train to give recommendations. You can copy-paste this code directly into the command line to run it. -@code +@code{.sh} wget http://www.mlpack.org/datasets/ml-20m/ratings-only.csv.gz wget http://www.mlpack.org/datasets/ml-20m/movies.csv.gz gunzip ratings-only.csv.gz @@ -190,7 +190,7 @@ done Here is some example output, showing that user 1 seems to have good taste in movies: -@code +@code{.unparsed} Recommendations for user 1: Casablanca (1942) Pan's Labyrinth (Laberinto del fauno, El) (2006) diff --git a/doc/guide/python_quickstart.hpp b/doc/guide/python_quickstart.hpp index 95941601fc..46e21b8f72 100644 --- a/doc/guide/python_quickstart.hpp +++ b/doc/guide/python_quickstart.hpp @@ -17,15 +17,15 @@ This quickstart guide is also available for @ref cli_quickstart "the command-lin Installing the mlpack bindings for Python is straightforward. First we have to install the dependencies (the code below is for Ubuntu), then we can build and -install mlpack. +install mlpack. You can copy-paste the commands into your shell. -@code -$ sudo apt-get install libboost-all-dev g++ cmake libarmadillo-dev python-pip wget -$ sudo pip install cython setuptools distutils numpy pandas -$ wget http://www.mlpack.org/files/mlpack-3.0.0.tar.gz -$ tar -xvzpf mlpack-3.0.0.tar.gz -$ mkdir -p mlpack-3.0.0/build/ && cd mlpack-3.0.0/build/ -$ cmake ../ && make -j4 && sudo make install +@code{.sh} +sudo apt-get install libboost-all-dev g++ cmake libarmadillo-dev python-pip wget +sudo pip install cython setuptools distutils numpy pandas +wget http://www.mlpack.org/files/mlpack-3.0.0.tar.gz +tar -xvzpf mlpack-3.0.0.tar.gz +mkdir -p mlpack-3.0.0/build/ && cd mlpack-3.0.0/build/ +cmake ../ && make -j4 && sudo make install @endcode @section python_quickstart_example Simple mlpack quickstart example @@ -38,7 +38,7 @@ print the accuracy of the random forest on the test dataset. You can copy-paste this code directly into Python to run it. -@code +@code{.py} import mlpack import pandas as pd import numpy as np @@ -113,13 +113,13 @@ mlpack. @section python_quickstart_movierecs Using mlpack for movie recommendations In this example, we'll train a collaborative filtering model using mlpack's -@c cf() method. We'll train this on the MovieLens dataset from +cf() method. We'll train this on the MovieLens dataset from https://grouplens.org/datasets/movielens/, and then we'll use the model that we train to give recommendations. You can copy-paste this code directly into Python to run it. -@code +@code{.py} import mlpack import pandas as pd import numpy as np @@ -159,7 +159,7 @@ for i in range(10): Here is some example output, showing that user 1 seems to have good taste in movies: -@code +@code{.unparsed} Recommendations for user 1: 0: Casablanca (1942) 1: Pan's Labyrinth (Laberinto del fauno, El) (2006)