Skip to content

Commit

Permalink
Added second example
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai Maruseac committed Mar 20, 2011
1 parent 1b8ca3b commit 8fa6f5f
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -17,13 +17,13 @@ purge:
$(RM) -r $(OBJS) $(TARGET) tags html

test_learn: $(TARGET)
$(DEBUG) $(TARGET) l -nfull tests/1/atribute.txt tests/1/invatare.txt tests/1/dump.txt
$(DEBUG) $(TARGET) l -nfull tests/2/atribute.txt tests/2/invatare.txt tests/2/dump.txt

test_graph: $(TARGET)
$(DEBUG) $(TARGET) g tests/1/dump.txt
$(DEBUG) $(TARGET) g tests/2/dump.txt

test_classify: $(TARGET)
$(DEBUG) $(TARGET) c tests/1/dump.txt tests/1/test.txt -
$(DEBUG) $(TARGET) c tests/2/dump.txt tests/2/test.txt -

doc:
doxygen > /dev/null
Expand Down
2 changes: 1 addition & 1 deletion id3graph.c
Expand Up @@ -186,7 +186,7 @@ void graph_ascii(const struct description *descr,
char *name, *val;

aid = cls->id;
name = descr->attribs[aid]->name;
name = aid != -1 ? descr->attribs[aid]->name : "unknown";

if (cls->C == 0) {
fprintf(out, "%*c==> %s\n", TABS * level + 1, ' ',
Expand Down
7 changes: 7 additions & 0 deletions tests/2/atribute.txt
@@ -0,0 +1,7 @@
3
Less Medium Greater
4
First numeric
Second numeric
Third numeric
Fourth numeric
14 changes: 14 additions & 0 deletions tests/2/dump.txt
@@ -0,0 +1,14 @@
3
Less Medium Greater
4
First numeric
Second numeric
Third numeric
Fourth numeric
0 2 3 6 10 0
1 0 0
2 1 3 4 5 0
3 0 0
4 1 0
5 1 0
6 2 0
24 changes: 24 additions & 0 deletions tests/2/invatare.txt
@@ -0,0 +1,24 @@
23
1 3 5 8 Less
6 8 10 20 Greater
6 7 8 9 Medium
6 8 9 10 Medium
4 5 9 10 Medium
4 ? 6 10 Medium
4 6 7 8 Medium
4 5 6 8 Medium
3 4 5 6 Less
2 ? 4 5 Less
10 12 16 18 Greater
3 3 4 9 Less
1 6 8 10 Medium
3 7 7 9 Medium
3 3 6 6 Less
5 ? ? 9 Medium
1 1 2 6 Less
2 4 5 8 Less
1 2 4 10 Less
1 2 ? 9 Less
7 7 7 8 Medium
3 4 ? 7 Medium
2 7 7 10 Medium
5 changes: 5 additions & 0 deletions tests/2/test.txt
@@ -0,0 +1,5 @@
4
3 5 9 10
1 4 4 6
2 8 9 9
1 8 8 9

0 comments on commit 8fa6f5f

Please sign in to comment.