Skip to content

Instantly share code, notes, and snippets.

@ysonggit
Last active March 18, 2020 11:28
Show Gist options
  • Save ysonggit/cee32b27f9f46e23b8ad7952d67116fb to your computer and use it in GitHub Desktop.
Save ysonggit/cee32b27f9f46e23b8ad7952d67116fb to your computer and use it in GitHub Desktop.

https://www.mlpack.org/doc/mlpack-git/doxygen/cli_quickstart.html

wget https://www.mlpack.org/datasets/covertype-small.data.csv.gz
wget https://www.mlpack.org/datasets/covertype-small.labels.csv.gz
gunzip covertype-small.data.csv.gz covertype-small.labels.csv.gz
# Split the dataset; 70% into a training set and 30% into a test set.
# Each of these options has a shorthand single-character option but here we type
# it all out for clarity.
mlpack_preprocess_split                                       \
    --input_file covertype-small.data.csv                     \
    --input_labels_file covertype-small.labels.csv            \
    --training_file covertype-small.train.csv                 \
    --training_labels_file covertype-small.train.labels.csv   \
    --test_file covertype-small.test.csv                      \
    --test_labels_file covertype-small.test.labels.csv        \
    --test_ratio 0.3                                          \
    --verbose
    
mlpack_nbc                                                    \
    --training_file covertype-small.train.csv                 \
    --labels_file covertype-small.train.labels.csv            \
    --output_model_file nbc-model.bin                         \
    --verbose

mlpack_nbc                                                    \
    --input_model_file nbc-model.bin                          \
    --test_file covertype-small.test.csv                      \
    --output_file pred_out.csv                                \
    --verbose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment