classifiers/nb-learn.c File Reference
#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/stat.h>
#include <libgen.h>
#include "../error/error.h"
#include "../hash/nps_vocab.c"
#include "nb.c"
Detailed Description
Author: Andrew Schein -*- c++ -*-
nb-learn is the command line executable that trains naive Bayes models. Its full usage is:
nb-learn [options] model_directory file
Options include:
[-h|--help] print this message and exit
[-a|--add=]<value> set count to add for laplace smoothing of both
P(c) and P(f_i|c)
[-m|--addMarginal=]<value> set count to add for laplace smoothing of P(c)
[-c|--addConditional=]<value> set count to add for laplace smoothing of P(f_i|c)
[-w|--wittenBell] use Witten-Bell smoothing instead of laplace
smoothing (-a, -c, -m ignored)
Define Documentation
Function Documentation
int main |
( |
int |
argc, |
|
|
char ** |
argv | |
|
) |
| | |
int parse_args |
( |
int |
argc, |
|
|
char ** |
argv | |
|
) |
| | |
void print_usage |
( |
FILE * |
f, |
|
|
char * |
progname | |
|
) |
| | |
Variable Documentation
Initial value: "usage: %s [options] model_directory file\n"
"Release: " HGVERSION "\n"
"Options include:\n"
"[-h|--help] print this message and exit\n"
"[-a|--add=]<value> set count to add for laplace smoothing of both\n"
" P(c) and P(f_i|c)\n"
"[-m|--addMarginal=]<value> set count to add for laplace smoothing of P(c)\n"
"[-c|--addConditional=]<value> set count to add for laplace smoothing of P(f_i|c)\n"
"[-w|--wittenBell] use Witten-Bell smoothing instead of laplace\n"
" smoothing (-a, -c, -m ignored)\n"