Пример #1
0
    def summary_final(self, show=True):
        # an alias
        subs = self.submissions

        # sorted indices of the mean ranks
        ranks = np.argsort([sub["ranking"] for sub in subs])

        teams = [subs[rank]["submitterAlias"] for rank in ranks]

        df = pd.DataFrame(index=teams, data=ranks, columns=["mean Rank"])

        # finally the ranks
        df["Team Name"] = [subs[rank]["submitterAlias"] for rank in ranks]
        df["Team Id"] = [subs[rank]["userId"] for rank in ranks]
        df["Submission Id"] = [subs[rank]["substatus"]["id"] for rank in ranks]
        df["Entity Id"] = [subs[rank]["substatus"]["entityId"] for rank in ranks]
        df["Mean Rank"] = [subs[rank]["ranking"] for rank in ranks]
        df["Mean RMSE"] = [subs[rank]["mean_rmse"] for rank in ranks]

        ranks = df["Mean Rank"].rank()
        df["Final Rank"] = ranks.values

        df = df.set_index("Final Rank")
        df = df[["Team Name", u"Team Id", u"Submission Id", u"Entity Id", "Mean Rank", u"Mean RMSE"]]

        ranks = np.argsort([sub["ranking"] for sub in subs])
        if show is False:
            return df

        print(dataframe_towiki(df))
        return df
Пример #2
0
    def summary_final(self, show=True):
        # an alias
        subs = self.submissions

        # sorted indices of the mean ranks
        ranks = np.argsort([sub['ranking'] for sub in subs])

        teams = [subs[rank]['submitterAlias'] for rank in ranks]

        df = pd.DataFrame(index=teams, data=ranks, columns=['mean Rank'])

        # finally the ranks
        df['Team Name'] = [subs[rank]['submitterAlias'] for rank in ranks]
        df['Team Id'] = [subs[rank]['userId'] for rank in ranks]
        df['Submission Id'] = [subs[rank]['substatus']['id'] for rank in ranks]
        df['Entity Id'] = [subs[rank]['substatus']['entityId'] for rank in ranks]
        df['Mean Rank'] = [subs[rank]['ranking'] for rank in ranks]
        df['Mean RMSE'] = [subs[rank]['mean_rmse'] for rank in ranks]

        ranks = df['Mean Rank'].rank()
        df['Final Rank'] = ranks.values

        df = df.set_index('Final Rank')
        df = df[['Team Name', u'Team Id', u'Submission Id', 
                u'Entity Id', 'Mean Rank', u'Mean RMSE']]
    
        ranks = np.argsort([sub['ranking'] for sub in subs])
        if show is False:
            return df

        print(dataframe_towiki(df))
        return df
Пример #3
0
    def summary_final(self, show=True):
        # an alias
        subs = self.submissions

        # sorted indices of the mean ranks
        ranks = np.argsort([sub['ranking'] for sub in subs])

        teams = [subs[rank]['submitterAlias'] for rank in ranks]

        df = pd.DataFrame(index=teams, data=ranks, columns=['mean Rank'])

        # finally the ranks
        df['Team Name'] = [subs[rank]['submitterAlias'] for rank in ranks]
        df['Team Id'] = [subs[rank]['userId'] for rank in ranks]
        df['Submission Id'] = [subs[rank]['substatus']['id'] for rank in ranks]
        df['Entity Id'] = [subs[rank]['substatus']['entityId'] for rank in ranks]
        df['Mean Rank'] = [subs[rank]['ranking'] for rank in ranks]
        df['Mean RMSE'] = [subs[rank]['mean_rmse'] for rank in ranks]

        ranks = df['Mean Rank'].rank()
        df['Final Rank'] = ranks.values

        df = df.set_index('Final Rank')
        df = df[['Team Name', u'Team Id', u'Submission Id', 
                u'Entity Id', 'Mean Rank', u'Mean RMSE']]
    
        ranks = np.argsort([sub['ranking'] for sub in subs])
        if show is False:
            return df

        print(dataframe_towiki(df))
        return df
Пример #4
0
 def __str__(self):
     df = self.get_ranking()
     from dreamtools.core.wikitools import dataframe_towiki
     print(dataframe_towiki(df))
Пример #5
0
 def __str__(self):
     df = self.get_ranking()
     from dreamtools.core.wikitools import dataframe_towiki
     print(dataframe_towiki(df))