All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.waikatodatamining.matrix.transformation.kernel.LinearKernel Maven / Gradle / Ivy

There is a newer version: 0.1.0
Show newest version
package com.github.waikatodatamining.matrix.transformation.kernel;

import com.github.waikatodatamining.matrix.core.Matrix;

/**
 * Linear Kernel.
 * 

* K(x_i,y_j)=x_i^T*y_j * or also * K(X, Y)=X*Y^T * * @author Steven Lang */ public class LinearKernel extends AbstractKernel { private static final long serialVersionUID = 841527107134287683L; @Override public double applyVector(Matrix x, Matrix y) { return x.vectorDot(y); } @Override public Matrix applyMatrix(Matrix X, Matrix Y) { return X.mul(Y.transpose()); } @Override public Matrix applyMatrix(Matrix X) { return this.applyMatrix(X, X); } @Override public String toString() { return "Linear Kernel: K(x,y)=x^T*y"; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy