@staticmethod
	def get_kernel(X, Y, type='linear', param=1.0):
		(Xdims,Xn) = X.size
		(Ydims,Yn) = Y.size
    	
		kernel = matrix(1.0)
		if type=='linear':
			print('Calculating linear kernel with size {0}x{1}.'.format(Xn,Yn))
			kernel = matrix([ dotu(X[:,i],Y[:,j]) for j in range(Yn) for i in range(Xn)], (Xn,Yn), 'd')

		if type=='rbf':
			print('Calculating Gaussian kernel with size {0}x{1}.'.format(Xn,Yn))
			kernel = matrix([dotu(X[:,i]-Y[:,j],X[:,i]-Y[:,j]) for j in range(Yn) for i in range(Xn)], (Xn,Yn))
			kernel = exp(-param*kernel)
		return kernel
Calculates a kernel given the data X and Y (dims x exms)
dataset/ETHPy150Open nicococo/tilitools/kernel.py/Kernel.get_kernel