Mercurial > hg > jslab
view src/samer/functions/LogisticHyperplane.java @ 5:b67a33c44de7
Remove some crap, etc
author | samer |
---|---|
date | Fri, 05 Apr 2019 21:34:25 +0100 |
parents | bf79fb79ee13 |
children |
line wrap: on
line source
package samer.functions; import samer.maths.*; public class LogisticHyperplane extends FunctionOfVector { double[] norm; double offset; Function fn; public LogisticHyperplane(int n) { this(new double[n],0); } public LogisticHyperplane(double [] norm, double offset) { this.offset=offset; this.norm=norm; fn=new Step(); } public void setFunction(Function f) { fn=f; } public void setOffset(double r) { offset=r; } public void setNormal(double [] n) { norm=n; } public double getOffset() { return offset; } public double[] getNormal() { return norm; } public double apply(double [] in) { return fn.apply(Mathx.dot(in,norm)-offset); } }