test optimal k, before predict