This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
id3learn.h
68 lines (62 loc) · 2.03 KB
/
id3learn.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*!
* @file id3learn.h
* @brief Learning part of the id3 classifier.
* @author Mihai Maruseac (mihai@rosedu.org)
*
* @section DESCRIPTION
* IAUT1: ID3: Learning part of the id3 classifier.
*
* Contains the definitions for the learning algorithms used in the ID3
* classification.
*
* @section QUOTE
* A year spent in artificial intelligence is enough to make one believe in
* God. (Alan Perlis)
*
* @bug No known bugs.
*/
#ifndef _ID3LEARN_H
#define _ID3LEARN_H
/**
* @brief Bootstraps the learning phase by reading data from the input files.
*
* It is simply a wrapper function around more useful functions, defined in
* this file.
*
* @param num_handle How to handle numeric arguments.
* @param missing_handle How to handle missing arguments.
* @param attr_file Filename for the attribute description file.
* @param learn_file Filename for the example set file.
* @param id3_file Filename used to output the classifier in a raw form.
* @return The exit code for the learning process.
*/
int id3_learn_bootstrap_file(int num_handle, int missing_handle,
FILE *attr_file, FILE *learn_file, FILE *id3_file);
/**
* @brief Builds a classifier obtained after splitting the example set
* according to one attribute.
*
* See the struct classifier documentation. This function is recursive too (it
* calls id3_learn and is called from it). Together they build the entire id3
* tree.
*
* @param descr The description of the problem.
* @param lset The learning set.
* @param tag Tag used to filter the learning set.
* @param id Id of attribute being split on
* @return Classifier
*/
struct classifier *split_on(const struct description *descr,
const struct example_set *lset, int tag, int id);
/**
* @brief Discretization of a single attribute.
*
* @param descr The description of the problem
* @param lset The learning set
* @param index Index of attribute
* @param num_handle How to do the discretization.
*/
void id3_attr_discr(const struct description *descr,
const struct example_set *lset,
int index, int num_handle);
#endif