kstar computation is mandatory when calling PAk #120
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I made the kstar computation mandatory in PAk. I believe that not doing so results in wrong outputs when kstar has been set before since the current PAk implementation does not recompute kstar if this attribute is already set. For instance, if we call "compute_density_kNN() ", then we are forced to call "compute_kstar()" before calling compute_density_PAk() to make sure that we do not use a constant k value in PAk. By definition PAk requires the computation of kstar, this is its main job and purpose. Not doing so, can produce a weird hybrid algorithm in which the free energy is optimized over a set of ks that do not belong to the philosophy of the algorithm. For this reason, I suggest making the computation of kstar mandatory. This is a cheap part computationally speaking, and the overhead for the (rather rare) cases in which the user calls explicitly the "compue_kstar" method before pak are negligible.