Skip to content

Commit 0c65ce5

Browse files
committed
Release 2.1.0
1 parent d11add0 commit 0c65ce5

File tree

4 files changed

+21
-40
lines changed

4 files changed

+21
-40
lines changed

README.md

+17-36
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ It encapsulates the cross-compiled Java code from **LIBSVM** behind an object-or
1010

1111
To use the latest release of **zlibsvm**, please use the following snippet in your `pom.xml`
1212

13-
#### Java 11+
13+
#### Java 17+
1414
```xml
1515
<dependency>
1616
<groupId>de.hs-heilbronn.mi</groupId>
1717
<artifactId>zlibsvm-core</artifactId>
18-
<version>2.0.9</version>
18+
<version>2.1.0</version>
1919
</dependency>
2020
```
2121

@@ -91,40 +91,21 @@ First of all, you need to implement your custom `SvmDocument` and a custom `SvmF
9191
```
9292

9393
```java
94-
public class SvmFeatureImpl implements SvmFeature {
95-
96-
private int index;
97-
private double value;
98-
99-
public SvmFeatureImpl(int index, double value) {
100-
this.index = index;
101-
this.value = value;
102-
}
103-
104-
public int getIndex() {
105-
return index;
106-
}
107-
108-
public double getValue() {
109-
return value;
110-
}
111-
112-
public void setIndex(int index) {
113-
this.index = index;
114-
115-
}
116-
117-
public void setValue(double value) {
118-
this.value = value;
119-
120-
}
121-
122-
@Override
123-
public int compareTo(SvmFeature o) {
124-
throw new UnsupportedOperationException("TODO: Implement this method for real use-cases");
125-
}
126-
}
127-
94+
public record SvmFeatureImpl(int index, double value) implements SvmFeature {
95+
96+
public int getIndex() {
97+
return index;
98+
}
99+
100+
public double getValue() {
101+
return value;
102+
}
103+
104+
@Override
105+
public int compareTo(SvmFeature o) {
106+
return Integer.compare(getIndex(), o.getIndex());
107+
}
108+
}
128109
```
129110

130111
To obtain an `SvmModel` the SVM needs to be trained. This is done via an `SvmConfigurationImpl.Builder()`, which is used to specify your custom SVM configuration.

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>de.hs-heilbronn.mi</groupId>
88
<artifactId>zlibsvm</artifactId>
99
<packaging>pom</packaging>
10-
<version>2.1.0-SNAPSHOT</version>
10+
<version>2.1.0</version>
1111

1212
<name>zlibsvm</name>
1313
<description>A Java binding for the famous LIBSVM library</description>
@@ -78,7 +78,7 @@
7878
<maven.compile.encoding>UTF-8</maven.compile.encoding>
7979
<maven.compiler.target>${java.target}</maven.compiler.target>
8080

81-
<zlibsvm.version>2.1.0-SNAPSHOT</zlibsvm.version>
81+
<zlibsvm.version>2.1.0</zlibsvm.version>
8282
<libsvm.version>3.31</libsvm.version>
8383
<!-- apache commons stuff -->
8484
<commons.lang3.version>3.13.0</commons.lang3.version>

zlibsvm-api/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>de.hs-heilbronn.mi</groupId>
77
<artifactId>zlibsvm</artifactId>
8-
<version>2.1.0-SNAPSHOT</version>
8+
<version>2.1.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

zlibsvm-core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>de.hs-heilbronn.mi</groupId>
77
<artifactId>zlibsvm</artifactId>
8-
<version>2.1.0-SNAPSHOT</version>
8+
<version>2.1.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

0 commit comments

Comments
 (0)