-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrainingSample.java
35 lines (30 loc) · 943 Bytes
/
TrainingSample.java
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
/*
* Container class for a training sample (feature array + similarity score).
*
* Copyright (C) 2013 Lisa Vitolo <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Creative Commons
* Attribution-NonCommercial-ShareAlike 3.0 license.
* You should have received a copy of the license with this product.
* Otherwise, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
*/
public class TrainingSample
{
public double[] features;
public double target;
public TrainingSample(double[] features, double target)
{
this.features = features;
this.target = target;
}
@Override public String toString()
{
String s = "[";
for (int i = 0; i < features.length; i++) {
s += features[i] + ", ";
}
s += "] -> " + target + "\n";
return s;
}
}