Enhance error handling with exceptions and add tests

This commit is contained in:
2025-06-27 19:02:52 +02:00
parent c408352daa
commit 9c1c427620
13 changed files with 335 additions and 11 deletions

View File

@@ -0,0 +1,10 @@
@relation test
@attribute feature1 real
@attribute feature2 real
@attribute feature1 real
@attribute class {A,B}
@data
1.0,2.0,3.0,A
4.0,5.0,6.0,B

View File

@@ -0,0 +1,9 @@
@relation test
@attribute feature1 real
@attribute real
@attribute class {A,B}
@data
1.0,2.0,A
4.0,5.0,B

View File

@@ -0,0 +1,9 @@
@relation test
@attribute feature1 real
@attribute feature2
@attribute class {A,B}
@data
1.0,2.0,A
4.0,5.0,B

View File

@@ -0,0 +1,7 @@
@relation test
% This file has no attributes defined
@data
1,2,3
4,5,6

View File

@@ -0,0 +1,10 @@
@relation test
@attribute feature1 {X,Y,Z}
@attribute feature2 real
@attribute class {A,B}
@data
X,2.0,A
,5.0,B
Z,8.0,A

View File

@@ -0,0 +1,10 @@
@relation test
@attribute feature1 real
@attribute feature2 real
@attribute class {A,B}
@data
1.0,2.0,A
4.0,5.0,
7.0,8.0,B

View File

@@ -0,0 +1,10 @@
@relation test
@attribute feature1 real
@attribute feature2 real
@attribute class {A,B}
@data
1.0,2.0,A
not_a_number,5.0,B
3.0,4.0,A

View File

@@ -0,0 +1,8 @@
@relation test
@attribute feature1 real
@attribute feature2 real
@attribute class {A,B}
@data
% No actual data samples

View File

@@ -0,0 +1,10 @@
@relation test
@attribute feature1 string
@attribute feature2 real
@attribute class {A,B}
@data
"What is this?",2.0,A
"Another question?",5.0,B
"No question",8.0,A

View File

@@ -0,0 +1,10 @@
@relation test
@attribute feature1 real
@attribute feature2 real
@attribute class {A,B}
@data
1.0,2.0,A
4.0,5.0,6.0,B,extra
7.0,C