Dynamic Learning (Machine Learning)
First some questions:


Can $k$ only take on 10 possible values?
From what you've said above, the measure of the 'quality' of a given value for $k$ would be an n-tuple e.g. $(accuracy,memory, time, storage)$, right?


So 'dynamically learning a value for $k$' involves learning a good choice based on $L$, the list of n-tuples for previous values of $k$.

Here are two very simple schemes:

If your problem is genuinely multi-objective, then you can always just pick the associated $k$ at random from the Pareto-front of $L$.

If your multiple objectives can be combined into a single quality value, then fit a differentiable curve (e.g. a polynomial) to these values, then symbolically determine the optimum of that curve and the associated value of $k$. Most computer algebra packages support the functionality for this, as does the Apache Commons Math library for Java.