Download Netica API C Version - Norsys Software Corp.
Transcript
32
NETICA API
C VERSION 4.18
Now the net is fully constructed in memory, and we could use it for inference, do net transforms, etc., but
in this example we just save it to a file for later use, by calling WriteNet_bn. The resulting file is a
pure ASCII text file which can be read back by Netica API or by Netica Application, whether they are
running on the same computer or another type of computer. The file adheres to the DNET format, which
is described in the document "DNET File Format". It will look similar to the below:
// ~->[DNET-1]->~
bnet Built_ChestClinic {
node VisitAsia {
kind = NATURE;
discrete = TRUE;
states = (visit, no_visit);
parents = ();
probs =
// visit
no_visit
(0.01,
0.99);
};
node Tuberculosis {
kind = NATURE;
discrete = TRUE;
states = (present, absent);
parents = (VisitAsia);
probs =
// present
absent
(0.05,
0.95,
0.01,
0.99);
};
// VisitAsia
// visit
// no_visit
node Smoking {
kind = NATURE;
discrete = TRUE;
states = (smoker, nonsmoker);
parents = ();
probs =
// smoker
nonsmoker
(0.5,
0.5);
};
node Cancer {
kind = NATURE;
discrete = TRUE;
states = (present, absent);
parents = (Smoking);
probs =
// present
absent
(0.1,
0.9,
0.01,
0.99);
title = "Lung Cancer";
};
// Smoking
// smoker
// nonsmoker