public void setCostParameters( Vectorizable costParameters) { if ( costParameters == null ) { this.goal = null; } else { this.goal = costParameters.convertToVector(); } }
@Override public void convertFromVector( Vector parameters ) { ((Vectorizable) this.getFirst()).convertFromVector( parameters ); }
public void setCostParameters( Vectorizable costParameters) { if ( costParameters == null ) { this.goal = null; } else { this.goal = costParameters.convertToVector(); } }
@Override public void convertFromVector( Vector parameters ) { ((Vectorizable) this.getFirst()).convertFromVector( parameters ); }
public void setCostParameters( Vectorizable costParameters) { if ( costParameters == null ) { this.goal = null; } else { this.goal = costParameters.convertToVector(); } }
@Override public void convertFromVector( Vector parameters ) { ((Vectorizable) this.getFirst()).convertFromVector( parameters ); }
/** * Evaluates the given input by converting it to a vector by calling the * proper method on the given {@code Vectorizable}. * * @param input * The input object. * @return * The vector form of the input. */ public Vector evaluate( final Vectorizable input) { return input.convertToVector(); } }
/** * Evaluates the given input by converting it to a vector by calling the * proper method on the given {@code Vectorizable}. * * @param input * The input object. * @return * The vector form of the input. */ public Vector evaluate( final Vectorizable input) { return input.convertToVector(); } }
/** * Evaluates the given input by converting it to a vector by calling the * proper method on the given {@code Vectorizable}. * * @param input * The input object. * @return * The vector form of the input. */ public Vector evaluate( final Vectorizable input) { return input.convertToVector(); } }
public double evaluate( final Vectorizable from, final Vectorizable to) { return from.convertToVector().cosine( to.convertToVector()); }
public double evaluate( final Vectorizable from, final Vectorizable to) { return from.convertToVector().cosine( to.convertToVector()); }
public double evaluate( final Vectorizable from, final Vectorizable to) { return from.convertToVector().cosine( to.convertToVector()); }
/** * Evaluates the Euclidean distance between the two given vectors. * * @param first The first Vector. * @param second The second Vector. * @return The Euclidean distance between the two given vectors. */ public double evaluate( Vectorizable first, Vectorizable second) { return first.convertToVector().euclideanDistance( second.convertToVector()); } }
/** * Evaluates the linear kernel by taking the inner product of the two * vectors. * * @param x The first vector. * @param y The second vector. * @return The dot product of the two vectors. */ public double evaluate( final Vectorizable x, final Vectorizable y) { return x.convertToVector().dotProduct(y.convertToVector()); }
/** * Evaluates the linear kernel by taking the inner product of the two * vectors. * * @param x The first vector. * @param y The second vector. * @return The dot product of the two vectors. */ public double evaluate( final Vectorizable x, final Vectorizable y) { return x.convertToVector().dotProduct(y.convertToVector()); }
/** * Evaluates the linear kernel by taking the inner product of the two * vectors. * * @param x The first vector. * @param y The second vector. * @return The dot product of the two vectors. */ public double evaluate( final Vectorizable x, final Vectorizable y) { return x.convertToVector().dotProduct(y.convertToVector()); }
/** * Evaluates the Euclidean distance between the two given vectors. * * @param first The first Vector. * @param second The second Vector. * @return The Euclidean distance between the two given vectors. */ public double evaluate( Vectorizable first, Vectorizable second) { return first.convertToVector().euclideanDistance( second.convertToVector()); } }
/** * The evaluates the squared Euclidean distance between the two given * vectors. * * @param first The first Vector. * @param second The second Vector. * @return The squared Euclidean distance between the two given vectors. */ public double evaluate( Vectorizable first, Vectorizable second) { return first.convertToVector().euclideanDistanceSquared( second.convertToVector()); } }
/** * Evaluates the Euclidean distance between the two given vectors. * * @param first The first Vector. * @param second The second Vector. * @return The Euclidean distance between the two given vectors. */ public double evaluate( Vectorizable first, Vectorizable second) { return first.convertToVector().euclideanDistance( second.convertToVector()); } }
/** * This kernel just evaluates the polynomial kernel between the two given * vectors, which is: (x dot y + c)^d. * * @param x The first vector. * @param y The second vector. * @return The result of the polynomial kernel: (x dot y + c)^d */ public double evaluate( final Vectorizable x, final Vectorizable y) { final double product = x.convertToVector().dotProduct(y.convertToVector()); return Math.pow(product + this.constant, this.degree); }