2020 ccf 华为Serverless工作负载预测baseline score=0.0846分享

   日期:2020-10-16     浏览:244    评论:0    
核心提示:赛题地址:https://www.datafountain.cn/competitions/468/datasets0.0846 code:import pandas as pdtestA_df = pd.read_csv('../data/evaluation_public.csv')sub = pd.read_csv('../data/submit_example.csv')cpu_mean = testA_df.groupby(['ID'])['CPU_USAGE'].mean()

赛题地址:https://www.datafountain.cn/competitions/468/datasets

0.0846 code:

import pandas as pd

testA_df = pd.read_csv('../data/evaluation_public.csv')
sub = pd.read_csv('../data/submit_example.csv')

cpu_mean = testA_df.groupby(['ID'])['CPU_USAGE'].mean()
cpu_mean = cpu_mean.reset_index()
job_mean = testA_df.groupby(['ID'])['LAUNCHING_JOB_NUMS'].mean()
job_mean = job_mean.reset_index()

cpu_last = testA_df.groupby(['ID'])['CPU_USAGE'].last()
cpu_last = cpu_last.reset_index()
job_last = testA_df.groupby(['ID'])['LAUNCHING_JOB_NUMS'].last()
job_last = job_last.reset_index()

for i in range(1,6):
    cpui = 'CPU_USAGE_' + str(i)
    jobi = 'LAUNCHING_JOB_NUMS_' + str(i)
    if i < 3:
        sub[cpui] = cpu_last['CPU_USAGE'].astype(int)
        sub[jobi] = job_last['LAUNCHING_JOB_NUMS'].astype(int)
    else:
        sub[cpui] = cpu_mean['CPU_USAGE'].astype(int)
        sub[jobi] = job_mean['LAUNCHING_JOB_NUMS'].astype(int)
sub.to_csv('../subs/test_groupby_id_last2_mean3.csv',index=None)

 

 
打赏
 本文转载自:网络 
所有权利归属于原作者,如文章来源标示错误或侵犯了您的权利请联系微信13520258486
更多>最近资讯中心
更多>最新资讯中心
0相关评论

推荐图文
推荐资讯中心
点击排行
最新信息
新手指南
采购商服务
供应商服务
交易安全
关注我们
手机网站:
新浪微博:
微信关注:

13520258486

周一至周五 9:00-18:00
(其他时间联系在线客服)

24小时在线客服