def ranker(self, X, meta):
        """
        Sort the place features list by the score of its relevance.
        """
        # total score is just a sum of each row
        total_score = X.sum(axis=1).transpose()
        total_score = np.squeeze(np.asarray(total_score))  # matrix to array
        ranks = total_score.argsort()
        ranks = ranks[::-1]
        # sort the list of dicts according to ranks
        sorted_meta = [meta[r] for r in ranks]
        sorted_X = X[ranks]
        return (sorted_X, sorted_meta)
def ranker ( self , X , meta ) : total_score = X . sum ( axis = 1 ) . transpose ( ) total_score = np . squeeze ( np . asarray ( total_score ) ) ranks = total_score . argsort ( ) ranks = ranks [ : : - 1 ] sorted_meta = [ meta [ r ] for r in ranks ] sorted_X = X [ ranks ] return ( sorted_X , sorted_meta )
Sort the place features list by the score of its relevance.