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"

Defines

#define _GNU_SOURCE

Functions

void print_usage (FILE *f, char *progname)
int parse_args (int argc, char **argv)
int main (int argc, char **argv)

Variables

double addMarginal = 1
double addConditional = 1
int use_wb = 0
char usage []

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

#define _GNU_SOURCE

Function Documentation

int main ( int  argc,
char **  argv 
)
int parse_args ( int  argc,
char **  argv 
)
void print_usage ( FILE *  f,
char *  progname 
)

Variable Documentation

double addConditional = 1
double addMarginal = 1
char usage[]
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"
int use_wb = 0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated on Sun Sep 11 09:40:46 2011 for NPSML by  doxygen 1.6.3