Skip to content

Clark/allow duplicated inputs#1

Open
clark-hive wants to merge 3 commits intomneilly:mneilly/cythonizefrom
CLARKBENHAM:clark/allow_duplicated_inputs
Open

Clark/allow duplicated inputs#1
clark-hive wants to merge 3 commits intomneilly:mneilly/cythonizefrom
CLARKBENHAM:clark/allow_duplicated_inputs

Conversation

@clark-hive
Copy link
Copy Markdown

@clark-hive clark-hive commented Sep 9, 2022

Currently if all rows of X are the same the proposal distribution q becomes an array of nan's and calling random_state.choice throws ValueError: probabilities contain NaN.

Here's a minimal reproducible example:

import kmc2  
import numpy as np

k=16
x= np.random.rand(8)
X=np.atleast_2d(x).repeat(repeats=10,axis=0)
print(kmc2.kmc2(X, k).astype(np.float32))

I ran into this on the third pytest case in the bolt repo.

This was mentioned later on in the thread where you originally made the fix to the bolt repo: dblalock/bolt#4 (comment) and recently raised again: dblalock/bolt#37.

Or would a better way be to check at the top for the matrix only having 1 unique row and returning that row K times?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant