@Test public void testSegment() { System.out.println("Segment"); MathEx.setSeed(19650218); double[][] x = MathEx.clone(Segment.x); double[][] testx = MathEx.clone(Segment.testx); MathEx.standardize(x); MathEx.standardize(testx); RBFNetwork<double[]> model = RBFNetwork.fit(x, Segment.y, RBF.fit(x, 30)); int[] prediction = Validation.test(model, testx); int error = Error.of(Segment.testy, prediction); System.out.println("RBF Network Error = " + error); assertEquals(123, error); model = RBFNetwork.fit(x, Segment.y, RBF.fit(x, 30), true); prediction = Validation.test(model, testx); error = Error.of(Segment.testy, prediction); System.out.println("Normalized RBF Network Error = " + error); assertEquals(110, error); }
public static <T> RBFNetwork<T> fit(T[] x, int[] y, RBF<T>[] rbf) { return fit(x, y, rbf, false); }
RBFNetwork implements Classifier<T> { public static <T> RBFNetwork<T> fit(T[] x, int[] y, RBF<T>[] rbf) { return fit(x, y, rbf, false); } }
RBFNetwork implements Classifier<T> { public static <T> RBFNetwork<T> fit(T[] x, int[] y, RBF<T>[] rbf) { return fit(x, y, rbf, false); } RBFNetwork(int k, RBF<T>[] rbf, Matrix w, boolean normalized);  RBFNetwork(int k, RBF<T>[] rbf, Matrix w, boolean normalized, IntSet labels); }
RBFNetwork implements Classifier<T> { public static <T> RBFNetwork<T> fit(T[] x, int[] y, RBF<T>[] rbf) { return fit(x, y, rbf, false); } RBFNetwork(int k, RBF<T>[] rbf, Matrix w, boolean normalized);  RBFNetwork(int k, RBF<T>[] rbf, Matrix w, boolean normalized, IntSet labels); static RBFNetwork<T> fit(T[] x, int[] y, RBF<T>[] rbf); static RBFNetwork<T> fit(T[] x, int[] y, RBF<T>[] rbf, boolean normalized); boolean isNormalized(); @Override int predict(T x); }
RBFNetwork implements Classifier<T> { public static <T> RBFNetwork<T> fit(T[] x, int[] y, RBF<T>[] rbf) { return fit(x, y, rbf, false); } RBFNetwork(int k, RBF<T>[] rbf, Matrix w, boolean normalized);  RBFNetwork(int k, RBF<T>[] rbf, Matrix w, boolean normalized, IntSet labels); static RBFNetwork<T> fit(T[] x, int[] y, RBF<T>[] rbf); static RBFNetwork<T> fit(T[] x, int[] y, RBF<T>[] rbf, boolean normalized); boolean isNormalized(); @Override int predict(T x);  }