df_extensions/space.py
def agreement(self, ks: List[int] = [1, 2, 3, 5, 10, 25]):
        """
        Given the result of 'join_distance' explore how similar
        items fall in 'top_k' for a range of values of k.
        """

        df = self._obj

        def get_average(k):
            return df.joint_space.same_nearest_k(k=k).mean().round(2)[0]

        r = pd.DataFrame({"top_k": ks})
        r["agreement"] = r["top_k"].apply(get_average)
        return r

        Given the result of 'join_distance' explore how similar
        items fall in 'top_k' for a range of values of k.
        
Given the result of 'join_distance' explore how similar
items fall in 'top_k' for a range of values of k.
Given the result of ' join_distance ' explore how similar items fall in ' top_k ' for a range of values of k .
def agreement(self, ks: List[int] = [1, 2, 3, 5, 10, 25]):
        df = self._obj
        def get_average(k):
            return df.joint_space.same_nearest_k(k=k).mean().round(2)[0]
        r = pd.DataFrame({"top_k": ks})
        r["agreement"] = r["top_k"].apply(get_average)
        return r
def agreement ( self , ks : List [ int ] = [ 1 , 2 , 3 , 5 , 10 , 25 ] ) : df = self . _obj def get_average ( k ) : return df . joint_space . same_nearest_k ( k = k ) . mean ( ) . round ( 2 ) [ 0 ] r = pd . DataFrame ( { "top_k" : ks } ) r [ "agreement" ] = r [ "top_k" ] . apply ( get_average ) return r
Given the result of 'join_distance' explore how similar
items fall in 'top_k' for a range of values of k.
Given the result of ' join_distance ' explore how similar items fall in ' top_k ' for a range of values of k .
"""
        Given the result of 'join_distance' explore how similar
        items fall in 'top_k' for a range of values of k.
        """
self
ks
List[int]