-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlearn.h
55 lines (43 loc) · 1003 Bytes
/
learn.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
// learn.h
#define getSRand() ( ( float ) rand( ) / ( float ) RAND_MAX )
#define getRand( x ) ( int ) ( ( x ) * getSRand( ) )
#define prob( x ) ( getSRand( ) > x )
#define MAX_NAME 40
#define MAX_FEATURES 21
typedef struct observation
{
char name[ MAX_NAME ];
// 21 Features
int hair;
int feathers;
int eggs;
int milk;
int airborne;
int aquatic;
int predator;
int toothed;
int backbone;
int breathes;
int venomous;
int fins;
int legs_0;
int legs_2;
int legs_4;
int legs_5;
int legs_6;
int legs_8;
int tail;
int domestic;
int catsize;
int class;
int computed_class;
} observation;
void set_changed( int );
int is_changed_set( void );
int get_observation( FILE*, observation* );
void vq_initialize( void );
void vq_train( FILE*, long iterations );
void vq_validate( FILE*, FILE* );
void art_initialize( FILE* );
void art_train( FILE* );
void art_validate( FILE*, FILE* );