コード例 #1
0
ファイル: classifier.py プロジェクト: fahad92virgo/knfst
    def predict(self, X):
        '''
        Returns +1 if the sample is predicted to be novel, -1 otherwise.
        '''
        ks = metrics.pairwise_kernels(X=self.X_train, Y=X, metric=self.metric)
        scores = score(self.projection, self.target_points, ks)
        prediction = np.array([1 if sc > self.threshold else -1 for sc in scores])

        return prediction
コード例 #2
0
ファイル: classifier.py プロジェクト: yen223/knfst
    def predict(self, X):
        '''
        Returns +1 if the sample is predicted to be novel, -1 otherwise.
        '''
        ks = metrics.pairwise_kernels(X=self.X_train, Y=X, metric=self.metric)
        scores = score(self.projection, self.target_points, ks)
        prediction = np.array(
            [1 if sc > self.threshold else -1 for sc in scores])

        return prediction
コード例 #3
0
ファイル: classifier.py プロジェクト: davidjwu/mclass-sky
    def predict(self, X):
        '''
        Returns +1 if the sample is predicted to be novel, -1 otherwise.

        The threshold is selected between 0 and the minimum distance between
        two target points.
        '''
        ks = metrics.pairwise_kernels(X=self.X_train, Y=X, metric=self.metric)
        scores = score(self.projection, self.target_points, ks)
        # min_dist = self._get_pairwise_min_dist()
        prediction = np.array([1 if sc > self.threshold else -1 for sc in scores])

        return scores
コード例 #4
0
    def predict(self, X):
        '''
        Returns +1 if the sample is predicted to be novel, -1 otherwise.

        The threshold is selected between 0 and the minimum distance between
        two target points.
        '''
        ks = metrics.pairwise_kernels(X=self.X_train, Y=X, metric=self.metric)
        scores = score(self.projection, self.target_points, ks)
        # min_dist = self._get_pairwise_min_dist()
        prediction = np.array(
            [1 if sc > self.threshold else -1 for sc in scores])

        return scores