Kernel based methods are increasingly being used for data modeling because of their conceptual simplicity and outstanding
performance on many tasks. However, in practice the kernel function is often chosen using trial-and-error heuristics. In this
paper we address the problem of measuring the degree of agreement between a kernel and a learning task. We propose a quantity
to capture this notion, which we call alignment. We study its theoretical properties, and derive a series of simple algorithms
for adapting a kernel to the targets. This produces a series of novel methods for both transductive and inductive inference,
kernel combination and kernel selection for both classification and regression problems that are computationally feasible
for large problems. The algorithms are tested on publicly available datasets and are shown to exhibit good performance.