You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-36
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,12 @@ It encapsulates the cross-compiled Java code from **LIBSVM** behind an object-or
10
10
11
11
To use the latest release of **zlibsvm**, please use the following snippet in your `pom.xml`
12
12
13
-
#### Java 11+
13
+
#### Java 17+
14
14
```xml
15
15
<dependency>
16
16
<groupId>de.hs-heilbronn.mi</groupId>
17
17
<artifactId>zlibsvm-core</artifactId>
18
-
<version>2.0.9</version>
18
+
<version>2.1.0</version>
19
19
</dependency>
20
20
```
21
21
@@ -91,40 +91,21 @@ First of all, you need to implement your custom `SvmDocument` and a custom `SvmF
91
91
```
92
92
93
93
```java
94
-
publicclassSvmFeatureImplimplementsSvmFeature {
95
-
96
-
privateint index;
97
-
privatedouble value;
98
-
99
-
publicSvmFeatureImpl(intindex, doublevalue) {
100
-
this.index = index;
101
-
this.value = value;
102
-
}
103
-
104
-
publicintgetIndex() {
105
-
return index;
106
-
}
107
-
108
-
publicdoublegetValue() {
109
-
return value;
110
-
}
111
-
112
-
publicvoidsetIndex(intindex) {
113
-
this.index = index;
114
-
115
-
}
116
-
117
-
publicvoidsetValue(doublevalue) {
118
-
this.value = value;
119
-
120
-
}
121
-
122
-
@Override
123
-
publicintcompareTo(SvmFeatureo) {
124
-
thrownewUnsupportedOperationException("TODO: Implement this method for real use-cases");
125
-
}
126
-
}
127
-
94
+
public record SvmFeatureImpl(int index, double value) implements SvmFeature {
95
+
96
+
publicint getIndex() {
97
+
return index;
98
+
}
99
+
100
+
publicdouble getValue() {
101
+
return value;
102
+
}
103
+
104
+
@Override
105
+
publicint compareTo(SvmFeature o) {
106
+
returnInteger.compare(getIndex(), o.getIndex());
107
+
}
108
+
}
128
109
```
129
110
130
111
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.
0 commit comments