/* Copyright (c) 1993 by The Johns Hopkins University */ /* METRIC.C: Routines for defining the distance metric */ /* between two instances */ #include #include #include "config.h" #include "pebls.h" extern config_type CONFIG; extern int count[CLASSES_MAX+1][FEATURES_MAX][VALUES_MAX]; extern float dtable[FEATURES_MAX][VALUES_MAX][VALUES_MAX]; extern instance_type data[INSTANCES_MAX]; /* ------------------------------------------------------------ */ /* INITIALIZE_TRAINING: Clear Value Counts Statistics */ void initialize_training(void) { int c,f,v,i; int instances = CONFIG.instances; for (c=0; c v2) dtable[f][v1][v2] = dtable[f][v2][v1]; else dtable[f][v1][v2] = dtable_entry(f,v1,v2); } } }