Skip to content

Pairwise constraints - unlabeled samples #1

@AVCarreiro

Description

@AVCarreiro

Hello, thanks for sharing your take on SDEC!

When looking at the code, especially at the code portion where the pairwise constraints are computed, I can't figure out how you deal with unlabeled data, as it's a semi-supervised setting (we should expect something like y = [0, 0, -1, 1, 0, 1, -1] e.g. where -1 means the data is unlabeled).

Even without unlabeled data, the pairwise constraints are a bit puzzling to me

def get_pairwise_constraints(Y):
        Y = Y.reshape(-1, 1)
        a = np.where(Y.dot(Y.T) == np.square(Y), 1, -1)
        return a

for example for y = [0, 0, 1] returns a matrix

[ [ 1, 1, 1]
[ 1, 1, 1]
[-1,-1,1]]

which is not even triangular, where I expected something like (0's must-link and 0-1 cannot link):

[ [ 1, 1,-1]
[ 1, 1,-1]
[-1,-1,1]]

Can you shed some light on this code please? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions