tno/mpc/protocols/secure_inner_join/helper.py
def _compute_intersection(self) -> None:
        """
        Compute the intersection between the hashed identifier columns of the data parties
        """
        # Get the dataframes with encrypted data
        data0 = np.asarray(self._databases[self.party_alice])[:, 1:]
        data1 = np.asarray(self._databases[self.party_bob])[:, 1:]

        identifiers_alice = self._databases[self.party_alice][:, 0]
        identifiers_bob = self._databases[self.party_bob][:, 0]

        # Determine intersecting indices
        _, alice_indices, bob_indices = np.intersect1d(
            identifiers_alice,
            identifiers_bob,
            assume_unique=True,
            return_indices=True,
        )

        # Mask respective arrays and hstack (concatenate) for final o/p
        self._feature_columns = {
            self.party_alice: list(range(0, data0.shape[1])),
            self.party_bob: list(
                range(data0.shape[1], data0.shape[1] + data1.shape[1])
            ),
        }
        self._intersection = np.hstack([data0[alice_indices, :], data1[bob_indices, :]])

        Compute the intersection between the hashed identifier columns of the data parties
        
Compute the intersection between the hashed identifier columns of the data parties
Compute the intersection between the hashed identifier columns of the data parties
def _compute_intersection(self) -> None:
        data0 = np.asarray(self._databases[self.party_alice])[:, 1:]
        data1 = np.asarray(self._databases[self.party_bob])[:, 1:]
        identifiers_alice = self._databases[self.party_alice][:, 0]
        identifiers_bob = self._databases[self.party_bob][:, 0]
        _, alice_indices, bob_indices = np.intersect1d(
            identifiers_alice,
            identifiers_bob,
            assume_unique=True,
            return_indices=True,
        )
        self._feature_columns = {
            self.party_alice: list(range(0, data0.shape[1])),
            self.party_bob: list(
                range(data0.shape[1], data0.shape[1] + data1.shape[1])
            ),
        }
        self._intersection = np.hstack([data0[alice_indices, :], data1[bob_indices, :]])
def _compute_intersection ( self ) -> None : data0 = np . asarray ( self . _databases [ self . party_alice ] ) [ : , 1 : ] data1 = np . asarray ( self . _databases [ self . party_bob ] ) [ : , 1 : ] identifiers_alice = self . _databases [ self . party_alice ] [ : , 0 ] identifiers_bob = self . _databases [ self . party_bob ] [ : , 0 ] _ , alice_indices , bob_indices = np . intersect1d ( identifiers_alice , identifiers_bob , assume_unique = True , return_indices = True , ) self . _feature_columns = { self . party_alice : list ( range ( 0 , data0 . shape [ 1 ] ) ) , self . party_bob : list ( range ( data0 . shape [ 1 ] , data0 . shape [ 1 ] + data1 . shape [ 1 ] ) ) , } self . _intersection = np . hstack ( [ data0 [ alice_indices , : ] , data1 [ bob_indices , : ] ] )
Compute the intersection between the hashed identifier columns of the data parties
Compute the intersection between the hashed identifier columns of the data parties
"""
        Compute the intersection between the hashed identifier columns of the data parties
        """ # Get the dataframes with encrypted data # Determine intersecting indices # Mask respective arrays and hstack (concatenate) for final o/p
self