Main Page   Compound List   File List   Compound Members   File Members  

interpolate.c File Reference

Find maximum-likelihood weights for interpolating several probabilistic models. More...

#include <stdio.h>
#include <strings.h>
#include <math.h>
#include <stdlib.h>
#include "rr_libs/general.h"
#include "pc_libs/pc_general.h"
#include "toolkit.h"

Go to the source code of this file.

Defines

#define ITEM_T   float
#define ITEM_FORMAT   "%f"
#define MCAPTION   20

Functions

void updateArgs (int *pargc, char **argv, int rm_cnt)
void eval (double *sum_logprobs, double **fractions, int *tag_of, int *n_in_tag, double *prob_components, double **lambdas, ITEM_T **model_probs, int ntags, int from_item, int to_item, int nmodels, char **captions, double *p_new_pp, int iter_no, double old_pp, int verbosity, FILE *probs_fp)
void main (int argc, char **argv)


Detailed Description

Find maximum-likelihood weights for interpolating several probabilistic models.

interpolate_v2: Find maximum-likelihood weights for interpolating several probabilistic models, where the models are described by their output on a common set of items (.fprobs file), previously derived from a common text file. "-test_last nnn" means that the last nnn items of each model will be used for testing. "-test_all" means _all_ items will be used for testing. "-test_first nnn" means that the first nnn items of each model will be used for testing and the last nnn items of each model will be used for training. "-test_cv" means to run in cross-validation mode, where each half of the test items will be used for training and testing, and the resulting PPs will be combined to give an overall PP value. If a partition of the items is induced via a "tags" mapping, separate weights will be calculated for each tag.

In "test" mode, run thru the main loop only once, to compute the test PP. The initial lambdas may be read from a file. For non-test-mode, they default to 1/#-of-models.

Roni Rosenfeld, 3/1/93 Adapted from the version I wrote for my "lm" software.

Definition in file interpolate.c.


Define Documentation

#define ITEM_FORMAT   "%f"
 

Definition at line 59 of file interpolate.c.

Referenced by main().

#define ITEM_T   float
 

Definition at line 58 of file interpolate.c.

Referenced by eval(), and main().

#define MCAPTION   20
 

Definition at line 60 of file interpolate.c.

Referenced by eval(), and main().


Function Documentation

void eval double *    sum_logprobs,
double **    fractions,
int *    tag_of,
int *    n_in_tag,
double *    prob_components,
double **    lambdas,
ITEM_T **    model_probs,
int    ntags,
int    from_item,
int    to_item,
int    nmodels,
char **    captions,
double *    p_new_pp,
int    iter_no,
double    old_pp,
int    verbosity,
FILE *    probs_fp
 

Definition at line 74 of file interpolate.c.

References fprintf(), ITEM_T, MCAPTION, pc_message(), and verbosity.

Referenced by main().

void main int    argc,
char **    argv
 

Definition at line 152 of file interpolate.c.

References Boolean, DEFAULT_VERBOSITY, eval(), fprintf(), free(), i, ITEM_FORMAT, ITEM_T, MCAPTION, pc_doublearg(), pc_flagarg(), pc_intarg(), pc_message(), pc_report_unk_args(), pc_stringarg(), quit(), report_version(), rr_calloc(), rr_iclose(), rr_iopen(), rr_malloc(), rr_oopen(), salloc(), updateArgs(), and verbosity.

void updateArgs int *    pargc,
char **    argv,
int    rm_cnt
 

Definition at line 63 of file interpolate.c.

References i, and updateArgs().

Referenced by main(), procComLine(), and updateArgs().


Generated on Tue Dec 21 13:54:47 2004 by doxygen1.2.18