Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate_candidates() doesn't work as expected - generates same triplet #265

Open
smejkka3 opened this issue Jul 29, 2022 · 0 comments
Open

Comments

@smejkka3
Copy link

Description

The function generate_candidates(X, strategy='graph_degree', target_rel='y', max_candidates=3) generates different output then shown in the example in the file, which is not correct as it is generating 3x the same array

Actual Behavior

import numpy as np
import networkx as nx
        
X = np.array([['a', 'y', 'b'],
            ['b', 'y', 'a'],
            ['a', 'y', 'c'],
            ['c', 'y', 'a'],
            ['a', 'y', 'd'],
            ['c', 'y', 'd'],
            ['b', 'y', 'c'],
            ['f', 'y', 'e']])
X_candidates = generate_candidates(X, strategy='graph_degree', target_rel='y', max_candidates=3)
array([['b', 'y', 'c'],
       ['b', 'y', 'c'],
       ['b', 'y', 'c']], dtype=object)

Expected Behavior

import numpy as np
import networkx as nx
        
X = np.array([['a', 'y', 'b'],
            ['b', 'y', 'a'],
            ['a', 'y', 'c'],
            ['c', 'y', 'a'],
            ['a', 'y', 'd'],
            ['c', 'y', 'd'],
            ['b', 'y', 'c'],
            ['f', 'y', 'e']])
X_candidates = generate_candidates(X, strategy='graph_degree', target_rel='y', max_candidates=3)
# ([['a', 'y', 'e'],
# ['f', 'y', 'a'],
# ['c', 'y', 'e']])

Steps to Reproduce

Run above mentioned code, ampligraph version = 1.4.0, numpy version = 1.19.5, networkx version=2.3

@smejkka3 smejkka3 changed the title generate_candidates() does generate same triplet generate_candidates() doesn't work as expected - generates same triplet Jul 29, 2022
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

No branches or pull requests

1 participant