機械学習なしで0.691(public 0.997)

コンペ楽しかったですね。運営のみなさまありがとうございました。

機械学習なしでpublic 0.997、private 0.691のGoogle Colabです。学習しないので1-2秒で計算が終わります。ラグ特徴量とか考慮してません。

  • 曜日ごと平均値か、最小二乗法を使って0.5の値を出す
  • 0.01, 0.1, 0.9, 0.99は標準偏差から計算する

なお、private 2位の本スコアコードはあまりにも酷いので公開しません(笑)というか、こっちの方がスコアいいという・・・

from google.colab import drive
drive.mount('/content/drive')
folder_path = "/content/drive/MyDrive/machine_learning/ps_conv/"

predict_folder_path = "/content/ps_conv/predict/"
!mkdir -p /content/ps_conv/predict/
Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount("/content/drive", force_remount=True).
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import datetime
import math
from sklearn import linear_model
train_raw_df = pd.read_csv(folder_path + "train_data.csv")
test_raw_df = pd.read_csv(folder_path + "test_data.csv")
submission_raw_df = pd.read_csv(folder_path + "submission.csv")

qs = [0.01, 0.1, 0.5, 0.9, 0.99]#予測4分点
products = ['ice1', 'ice2', 'ice3', 'oden1', 'oden2', 'oden3', 'oden4', 'hot1', 'hot2', 'hot3', 'dessert1',
       'dessert2', 'dessert3', 'dessert4', 'dessert5', 'drink1', 'drink2', 'drink3', 'drink4', 'drink5', 'drink6', 'alcol1', 'alcol2', 'alcol3',
       'snack1', 'snack2', 'snack3', 'bento1', 'bento2', 'bento3', 'bento4',  'tild1', 'tild2', 'men1', 'men2', 'men3', 'men4', 'men5', 'men6']

製品で共通の計算

#date追加 trainは1-3月が2022, testは全て2022(曜日みると2018, 2019の方がよかったっぽい)
def dates(is_train):
  date_list = train_raw_df["date"] if is_train else test_raw_df["date"]
  X_date_split = date_list.str.split("/", expand=True)#4/12など
  X_date_split.columns = ["month", "day"]
  X_date_split["month"] = X_date_split["month"].astype(int)
  X_date_split["year"] = "2022"
  if is_train:
    X_date_split.loc[X_date_split["month"]>3, "year"] = "2021"

  X_date_split["month"] = X_date_split["month"].astype(str)  
  X_date_split["day"] = X_date_split["day"].astype(str)
  X_date_split["date"] = X_date_split["year"] + X_date_split["month"].str.zfill(2) + X_date_split["day"].str.zfill(2)
  return pd.to_datetime(X_date_split["date"])
def preprocess(is_train):
  df = train_raw_df.copy() if is_train else test_raw_df.copy()
  df["date"] = dates(is_train=is_train)
  df["day"] = df["date"].dt.day
  df["weekday"] = df["date"].dt.weekday
  df["rain_day"] = np.where(df["rain"]>0,1,0)
  df["sunny_and_rain"] = np.where((df["rain_day"]==0) & (df["rain_day"].shift(-1)==1),1,0)
  df["period_in_week"] = np.where(df["day"] > 7, 1, 0)
  df["period_in_week"] = np.where(df["day"] > 21, 2, df["period_in_week"])
  return df
train_df = preprocess(is_train=True)
test_df = preprocess(is_train=False)
def percentiles_from(mean, std):
  std99 = 2.33
  std90 = 1.29
  adj99 = 1.25 #高めの数値を異常値として比較的削っているので調整(値適当)
  adj90 = 1.23 #高めの数値を異常値として比較的削っているので調整(値適当)
  p_01 = (mean - std99 * std)
  p_10 = (mean - std90 * std)
  p_50 = (mean)
  p_90 = (mean + std90 * std * adj90)
  p_99 = (mean + std99 * std * adj99)
  return [p_01, p_10, p_50, p_90, p_99]
  #p_01, p_99 = stats.norm.interval(alpha=0.98, loc=mean, scale=std)
  #p_10, p_90 = stats.norm.interval(alpha=0.80, loc=mean, scale=std)
def calc_percentiles(sr):
  mean = sr.mean()
  std = sr.std()
  return percentiles_from(mean=mean, std=std)
#曜日ごと計算
def weekday_calc(df, weekday, column):
  df = df[df["weekday"]==weekday]
  return calc_percentiles(df[column])
#処理済みのdfと最小二乗法のx, yを渡すとpercentileが返る
def percentiles_calc_by_linear(df, calc_col, target_col):
    clf = linear_model.LinearRegression()
    clf.fit(df[calc_col].values.reshape(-1,1), df[target_col])
    mn = clf.predict(np.array(row[calc_col]).reshape(1,-1))[0]
    diff = df[target_col] - df[calc_col] * clf.coef_ #これ計算しなくても出た気がする
    return percentiles_from(mean=mn, std=diff.std())
#異常値を削除
def drop_outliers(df, ols):
  ols = [o for o in ols if o in df.index]
  if len(ols) > 0:
    df = df.drop(ols)
  return df

各プロダクト処理関数

ice1, ice2, ice3: highestで綺麗な分布。3のみ標準偏差が大きい

oden1, oden2, oden3, oden4, : lowestで綺麗な分布。ただし、10度付近で傾きが変わることに注意

hot1, hot2, hot3: lowestで15度を境として綺麗に分布, weekday =2,3,5,6が売上が比較的良い

'dessert1', 'dessert2', 'dessert3', 'dessert4', 'dessert5', : 3,6が明確に高い。16日、26日にピークが来てそこから下がっていく。ここの補正幅は種類によって違いそう

'drink1', 'drink2', 'drink3', 'drink4': highestで綺麗に分布、17-18度くらいで傾きが変わる。雨の影響受ける

'drink5', 'drink6', highestで広く分布。予想がしづらいが値が低い。雨の影響受ける

'alcol1', 'alcol2', 'alcol3', 曜日の影響が非常に大きい。雨の影響受ける

'snack1', 'snack2', 'snack3', 曜日のみ

'bento1', 'bento2', 'bento3', 'bento4', 曜日のみ

'tild1', 'tild2', 「晴れかつ次の日雨」で二つに別れる。曜日考慮

'men1', 'men2', 'men3', 'men4', 'men5', 'men6' 曜日依存、「晴れかつ次の日雨」影響

def ice_calc(num, row):
    col = "ice" + str(num)
    outliers = {
        1: [341], 2:[], 3:[], 
    }
    df = train_df.copy()
    df = drop_outliers(df, outliers[num])

    #高温度で曲がるので計算の範囲内に落とす
    df = df[df["highest"] > 8]
    df = df[df["highest"] < 23] #187行

    return percentiles_calc_by_linear(df, "highest", col)
def oden_calc(num, row):
    col = "oden" + str(num)
    outliers = {
        1: [236, 15, 187, 178, 70], 2:[298, 307, 33], 3:[239, 276, 40, 43], 4:[325], 
    }
    df = train_df.copy()
    df = drop_outliers(df, outliers[num])
    df = df[df[col]!=0]

    #温度で角度変わる
    temp_threshold = 10 if num == 2 else 9
    if row["lowest"] > temp_threshold:
      df = df[df["lowest"] > (temp_threshold - 1)] #131行
    else:
      df = df[df["lowest"] <= (temp_threshold + 1)] #122行

    return percentiles_calc_by_linear(df, "lowest", col)
def hot_calc(num, row):
    col = "hot" + str(num)
    df = train_df.copy()
    
    #高温度で曲がるので計算の範囲内に落とす
    df = df[df["lowest"] < 14.5] #182行

    if row["weekday"] in [0,1,4]:
      df = df[df["weekday"].isin([0, 1, 4])]
    else:
      df = df[df["weekday"].isin([2, 3, 5, 6])]

    return percentiles_calc_by_linear(df, "lowest", col)
def dessert_calc(num, row):
  col = "dessert" + str(num)
  df = train_df.copy()
  #16,26日にピークがあり、そこから数日かけて下がっていく
  days = []
  if row["day"] in [16,26]:
    days = [16,26]
  elif row["day"] in [17,27]:
    days = [17,27]
  elif row["day"] in [18,28]:
    days = [18,28]
  elif row["day"] in [19,29]:
    days = [19,29]
  else:
    days = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,20,21,22,23,24,25,30,31]
  
  df = df[df["day"].isin(days)]
  if row["weekday"] in [3,6]:
    df = df[df["weekday"].isin([3,6])]
  else:
    df = df[df["weekday"].isin([0,1,2,4,5])]
  return calc_percentiles(df[col])
def drink1234_calc(num, row):
    col = "drink" + str(num)
    outliers = { #2はもう少し落とせそう
        1: [], 2:[303, 296, 289, 212, 177, 58, 37, 79, 142], 3:[87, 163, 30, 72, 58],  4:[]
    }
    df = train_df.copy()
    df = drop_outliers(df, outliers[num])

    #drink1,2,3はrainで処理を分ける
    if num != 4:
      if row["rain"] > 2:
        df = df[df["rain"]>2]
      else:
        df = df[df["rain"]<=2]

    #15度未満は平均値
    if row["highest"] < 15:
      df = df[df["highest"]<15]
      return calc_percentiles(df[col])
    #15度以上は最小二乗法
    else:
      df = df[df["highest"]>=15]
      return percentiles_calc_by_linear(df, "highest", col)
#'drink5', 'drink6', 
def drink56_calc(num, row):
  col = "drink" + str(num)
  df = train_df.copy()
  df = df[df["highest"]>9.2] #testのhighestが9.3-だから
  shreshold = 2
  if row["rain"] > shreshold:
    df = df[df["rain"] > shreshold]
  else:
    df = df[df["rain"] <= shreshold]
  return calc_percentiles(df[col])
def alcol_calc(num, row):
  col = "alcol" + str(num)
  outliers = {
      1: [246,], 2:[143], 3:[60, 176, 211]
  }
  df = train_df.copy()
  df = drop_outliers(df, outliers[num])
  shreshold = 8
  if row["rain"] > shreshold:
    df = df[df["rain"]>shreshold]
  else:
    df = df[df["rain"]<=shreshold]
  return weekday_calc(df, row["weekday"], col)
def snack_calc(num, row):
  col = "snack" + str(num)
  outliers = {
      1: [268,310,77], 2:[5], 3:[]
  }
  df = train_df.copy()
  df = drop_outliers(df, outliers[num])
  return weekday_calc(df, row["weekday"], col)
def bento_calc(num, row):
  col = "bento" + str(num)
  outliers = {
      1: [133,154,63], 2:[151,235], 3:[144, 280, 266], 4:[295, 27, 20], 
  }
  df = train_df.copy()
  df = drop_outliers(df, outliers[num])
  return weekday_calc(df, row["weekday"], col)
def tild_calc(num, row):
  col = "tild" + str(num)
  outliers = {
      1: [], 2:[35],
  }
  df = train_df.copy()
  df = drop_outliers(df, outliers[num])
  df = df[df["sunny_and_rain"]==row["sunny_and_rain"]]
  if row["sunny_and_rain"] == 1:
    if row["weekday"] == 6: #日数が少ないので合算する
      df = df[df["weekday"]==6]
    else:
      df = df[df["weekday"]!=6]
    return calc_percentiles(df[col])
  else:
    return weekday_calc(df, row["weekday"], col)
def men_calc(num, row):
  col = "men" + str(num)
  outliers = {
      1: [283, 293], 2:[62], 3:[], 4:[], 5:[84], 6:[27, 185],  
  }
  df = train_df.copy()
  df = drop_outliers(df, outliers[num])
  df = df[df["sunny_and_rain"]==row["sunny_and_rain"]]
  if row["sunny_and_rain"] == 1:
    if row["weekday"] in [0, 1, 4]: #日数が少ないので合算する
      df = df[df["weekday"].isin([0, 1, 4])]
    else:
      df = df[df["weekday"].isin([2, 3, 5, 6])]
    return calc_percentiles(df[col])
  else:
    return weekday_calc(df, row["weekday"], col)

最終処理

results = []

for idx, row in test_df.iterrows():
  row_result = []
  for i in range(1,4):
    row_result.extend(ice_calc(i, row))
  for i in range(1,5):
    row_result.extend(oden_calc(i, row))
  for i in range(1,4):
    row_result.extend(hot_calc(i, row))
  for i in range(1,6):
    row_result.extend(dessert_calc(i, row))
  for i in range(1,5):
    row_result.extend(drink1234_calc(i, row))
  for i in [5,6]:
    row_result.extend(drink56_calc(i, row))
  for i in range(1,4):
    row_result.extend(alcol_calc(i, row))
  for i in range(1,4):
    row_result.extend(snack_calc(i, row))
  for i in range(1,5):
    row_result.extend(bento_calc(i, row))
  for i in range(1,3):
    row_result.extend(tild_calc(i, row))
  for i in range(1,7):
    row_result.extend(men_calc(i, row))
  results.append(row_result)

results = pd.DataFrame(results)
results = results.where(results > 0, 0)
results = results.round()
cols = []
for pr in products:
  cols.extend([pr + "_" + str(q) for q in qs])
results.columns = cols
results
0 1 2 3 4 5 6 7 8 9 ... 11 12 13 14 15 16 17 18 19 20
ice1_0.01 18.0 17.0 13.0 14.0 17.0 16.0 15.0 15.0 17.0 20.0 ... 19.0 16.0 17.0 13.0 17.0 14.0 18.0 18.0 20.0 19.0
ice1_0.1 20.0 18.0 14.0 15.0 18.0 18.0 16.0 17.0 18.0 21.0 ... 21.0 17.0 18.0 14.0 18.0 16.0 19.0 19.0 21.0 20.0
ice1_0.5 21.0 20.0 16.0 17.0 20.0 19.0 18.0 18.0 20.0 23.0 ... 22.0 19.0 20.0 16.0 20.0 17.0 21.0 21.0 23.0 22.0
ice1_0.9 23.0 22.0 18.0 19.0 22.0 22.0 20.0 20.0 22.0 25.0 ... 25.0 21.0 22.0 18.0 22.0 20.0 23.0 23.0 25.0 24.0
ice1_0.99 25.0 24.0 19.0 21.0 23.0 23.0 22.0 22.0 24.0 27.0 ... 26.0 22.0 24.0 20.0 24.0 21.0 24.0 24.0 27.0 26.0
ice2_0.01 63.0 54.0 31.0 39.0 53.0 52.0 43.0 46.0 54.0 71.0 ... 69.0 48.0 54.0 34.0 54.0 41.0 58.0 59.0 72.0 67.0
ice2_0.1 64.0 55.0 32.0 39.0 53.0 53.0 44.0 47.0 54.0 72.0 ... 69.0 49.0 55.0 35.0 54.0 42.0 59.0 59.0 73.0 68.0
ice2_0.5 64.0 56.0 33.0 40.0 54.0 54.0 44.0 47.0 55.0 73.0 ... 70.0 49.0 56.0 36.0 55.0 43.0 60.0 60.0 73.0 68.0
ice2_0.9 65.0 57.0 34.0 41.0 55.0 55.0 45.0 48.0 56.0 74.0 ... 71.0 50.0 57.0 36.0 56.0 44.0 61.0 61.0 74.0 69.0
ice2_0.99 66.0 58.0 35.0 42.0 56.0 55.0 46.0 49.0 57.0 75.0 ... 72.0 51.0 58.0 37.0 57.0 45.0 62.0 62.0 75.0 70.0
ice3_0.01 24.0 23.0 22.0 22.0 23.0 23.0 22.0 23.0 23.0 24.0 ... 24.0 23.0 23.0 22.0 23.0 22.0 23.0 24.0 24.0 24.0
ice3_0.1 27.0 26.0 25.0 25.0 26.0 26.0 25.0 26.0 26.0 27.0 ... 27.0 26.0 26.0 25.0 26.0 25.0 26.0 26.0 27.0 27.0
ice3_0.5 30.0 30.0 28.0 29.0 30.0 29.0 29.0 29.0 30.0 31.0 ... 31.0 29.0 30.0 28.0 30.0 29.0 30.0 30.0 31.0 30.0
ice3_0.9 35.0 34.0 32.0 33.0 34.0 34.0 33.0 33.0 34.0 35.0 ... 35.0 34.0 34.0 33.0 34.0 33.0 34.0 34.0 35.0 35.0
ice3_0.99 38.0 38.0 36.0 37.0 38.0 38.0 37.0 37.0 38.0 39.0 ... 39.0 37.0 38.0 36.0 38.0 37.0 38.0 38.0 39.0 38.0
oden1_0.01 26.0 10.0 30.0 27.0 26.0 54.0 71.0 68.0 61.0 31.0 ... 8.0 38.0 53.0 59.0 52.0 24.0 42.0 9.0 7.0 9.0
oden1_0.1 33.0 17.0 37.0 34.0 33.0 61.0 78.0 75.0 68.0 38.0 ... 12.0 45.0 60.0 66.0 59.0 31.0 49.0 13.0 11.0 13.0
oden1_0.5 41.0 26.0 46.0 42.0 41.0 70.0 87.0 83.0 77.0 47.0 ... 17.0 54.0 69.0 75.0 68.0 39.0 58.0 18.0 15.0 17.0
oden1_0.9 52.0 36.0 57.0 53.0 52.0 80.0 98.0 94.0 88.0 57.0 ... 23.0 65.0 79.0 86.0 78.0 50.0 68.0 24.0 21.0 23.0
oden1_0.99 61.0 45.0 66.0 62.0 61.0 89.0 107.0 103.0 97.0 66.0 ... 28.0 74.0 88.0 95.0 87.0 59.0 77.0 29.0 26.0 28.0
oden2_0.01 37.0 23.0 41.0 37.0 37.0 62.0 78.0 74.0 69.0 42.0 ... 22.0 48.0 61.0 67.0 60.0 35.0 51.0 17.0 20.0 22.0
oden2_0.1 44.0 30.0 48.0 45.0 44.0 69.0 85.0 82.0 76.0 49.0 ... 24.0 55.0 68.0 74.0 68.0 42.0 59.0 24.0 22.0 25.0
oden2_0.5 53.0 39.0 57.0 53.0 53.0 78.0 94.0 90.0 85.0 58.0 ... 27.0 64.0 77.0 83.0 76.0 51.0 67.0 33.0 25.0 28.0
oden2_0.9 63.0 49.0 68.0 64.0 63.0 89.0 105.0 101.0 95.0 68.0 ... 31.0 75.0 88.0 94.0 87.0 62.0 78.0 44.0 29.0 32.0
oden2_0.99 73.0 59.0 77.0 73.0 73.0 98.0 114.0 110.0 105.0 77.0 ... 34.0 84.0 97.0 103.0 96.0 71.0 87.0 53.0 32.0 35.0
oden3_0.01 76.0 49.0 83.0 77.0 76.0 125.0 155.0 148.0 137.0 85.0 ... 46.0 98.0 123.0 134.0 121.0 72.0 104.0 50.0 40.0 48.0
oden3_0.1 88.0 62.0 96.0 90.0 88.0 137.0 167.0 161.0 150.0 98.0 ... 53.0 111.0 136.0 147.0 134.0 85.0 117.0 57.0 47.0 55.0
oden3_0.5 104.0 77.0 112.0 106.0 104.0 153.0 183.0 177.0 166.0 114.0 ... 62.0 126.0 152.0 163.0 150.0 101.0 133.0 66.0 56.0 64.0
oden3_0.9 124.0 97.0 132.0 125.0 124.0 173.0 203.0 196.0 185.0 133.0 ... 73.0 146.0 171.0 182.0 170.0 121.0 152.0 77.0 67.0 75.0
oden3_0.99 140.0 113.0 148.0 142.0 140.0 189.0 219.0 213.0 202.0 150.0 ... 82.0 162.0 188.0 199.0 186.0 137.0 169.0 86.0 76.0 84.0
oden4_0.01 47.0 32.0 51.0 48.0 47.0 74.0 91.0 88.0 82.0 52.0 ... 31.0 59.0 74.0 80.0 73.0 45.0 63.0 34.0 26.0 32.0
oden4_0.1 55.0 40.0 60.0 56.0 55.0 83.0 100.0 96.0 90.0 61.0 ... 36.0 68.0 82.0 88.0 81.0 53.0 71.0 38.0 31.0 37.0
oden4_0.5 66.0 51.0 70.0 67.0 66.0 93.0 110.0 107.0 101.0 71.0 ... 42.0 78.0 93.0 99.0 92.0 64.0 82.0 44.0 37.0 43.0
oden4_0.9 79.0 64.0 83.0 80.0 79.0 106.0 123.0 120.0 113.0 84.0 ... 49.0 91.0 105.0 112.0 105.0 77.0 95.0 51.0 44.0 50.0
oden4_0.99 89.0 74.0 94.0 90.0 89.0 117.0 134.0 131.0 124.0 95.0 ... 55.0 102.0 116.0 122.0 115.0 88.0 106.0 57.0 50.0 56.0
hot1_0.01 133.0 131.0 113.0 132.0 133.0 92.0 88.0 92.0 86.0 112.0 ... 161.0 106.0 106.0 100.0 94.0 119.0 117.0 154.0 151.0 158.0
hot1_0.1 142.0 140.0 122.0 141.0 142.0 101.0 97.0 101.0 95.0 121.0 ... 170.0 115.0 115.0 109.0 103.0 128.0 126.0 163.0 160.0 167.0
hot1_0.5 153.0 151.0 133.0 152.0 153.0 112.0 108.0 112.0 106.0 132.0 ... 181.0 126.0 126.0 120.0 114.0 139.0 137.0 175.0 171.0 178.0
hot1_0.9 167.0 164.0 147.0 166.0 167.0 126.0 122.0 126.0 120.0 146.0 ... 195.0 140.0 140.0 134.0 128.0 152.0 151.0 188.0 185.0 192.0
hot1_0.99 178.0 176.0 158.0 178.0 178.0 137.0 134.0 137.0 131.0 157.0 ... 206.0 151.0 152.0 145.0 139.0 164.0 162.0 200.0 196.0 203.0
hot2_0.01 202.0 187.0 178.0 201.0 202.0 168.0 178.0 180.0 165.0 178.0 ... 217.0 174.0 187.0 184.0 169.0 181.0 193.0 213.0 197.0 215.0
hot2_0.1 214.0 200.0 191.0 214.0 214.0 181.0 190.0 192.0 178.0 191.0 ... 229.0 188.0 200.0 197.0 182.0 194.0 206.0 226.0 210.0 228.0
hot2_0.5 230.0 217.0 208.0 230.0 230.0 198.0 206.0 208.0 195.0 208.0 ... 245.0 205.0 216.0 212.0 199.0 211.0 221.0 242.0 227.0 243.0
hot2_0.9 249.0 237.0 229.0 249.0 249.0 218.0 225.0 227.0 215.0 228.0 ... 264.0 225.0 235.0 231.0 219.0 231.0 241.0 261.0 247.0 263.0
hot2_0.99 265.0 254.0 246.0 265.0 265.0 236.0 241.0 243.0 232.0 245.0 ... 280.0 242.0 251.0 248.0 236.0 248.0 257.0 277.0 265.0 279.0
hot3_0.01 206.0 191.0 181.0 206.0 206.0 168.0 175.0 178.0 164.0 180.0 ... 226.0 176.0 188.0 183.0 169.0 184.0 195.0 221.0 204.0 224.0
hot3_0.1 219.0 204.0 194.0 218.0 219.0 181.0 187.0 190.0 177.0 193.0 ... 238.0 189.0 200.0 195.0 182.0 197.0 207.0 233.0 217.0 236.0
hot3_0.5 234.0 221.0 210.0 233.0 234.0 197.0 203.0 205.0 193.0 209.0 ... 253.0 205.0 215.0 211.0 198.0 213.0 222.0 249.0 233.0 251.0
hot3_0.9 252.0 240.0 229.0 252.0 252.0 217.0 221.0 224.0 213.0 229.0 ... 272.0 225.0 234.0 229.0 218.0 233.0 241.0 267.0 253.0 270.0
hot3_0.99 268.0 257.0 246.0 267.0 268.0 233.0 237.0 239.0 229.0 245.0 ... 287.0 242.0 249.0 245.0 234.0 249.0 257.0 283.0 270.0 285.0
dessert1_0.01 45.0 26.0 25.0 17.0 36.0 17.0 17.0 36.0 17.0 17.0 ... 36.0 17.0 17.0 36.0 17.0 17.0 17.0 36.0 17.0 33.0
dessert1_0.1 48.0 28.0 26.0 19.0 39.0 19.0 19.0 39.0 19.0 19.0 ... 39.0 19.0 19.0 39.0 19.0 19.0 19.0 39.0 19.0 35.0
dessert1_0.5 53.0 30.0 28.0 22.0 43.0 22.0 22.0 43.0 22.0 22.0 ... 43.0 22.0 22.0 43.0 22.0 22.0 22.0 43.0 22.0 37.0
dessert1_0.9 58.0 33.0 31.0 26.0 47.0 26.0 26.0 47.0 26.0 26.0 ... 47.0 26.0 26.0 47.0 26.0 26.0 26.0 47.0 26.0 39.0
dessert1_0.99 63.0 35.0 33.0 30.0 51.0 30.0 30.0 51.0 30.0 30.0 ... 51.0 30.0 30.0 51.0 30.0 30.0 30.0 51.0 30.0 41.0
dessert2_0.01 69.0 45.0 41.0 34.0 54.0 34.0 34.0 54.0 34.0 34.0 ... 54.0 34.0 34.0 54.0 34.0 34.0 34.0 54.0 34.0 53.0
dessert2_0.1 73.0 48.0 43.0 37.0 57.0 37.0 37.0 57.0 37.0 37.0 ... 57.0 37.0 37.0 57.0 37.0 37.0 37.0 57.0 37.0 57.0
dessert2_0.5 79.0 51.0 46.0 41.0 62.0 41.0 41.0 62.0 41.0 41.0 ... 62.0 41.0 41.0 62.0 41.0 41.0 41.0 62.0 41.0 61.0
dessert2_0.9 85.0 55.0 50.0 46.0 68.0 46.0 46.0 68.0 46.0 46.0 ... 68.0 46.0 46.0 68.0 46.0 46.0 46.0 68.0 46.0 67.0
dessert2_0.99 91.0 59.0 53.0 50.0 73.0 50.0 50.0 73.0 50.0 50.0 ... 73.0 50.0 50.0 73.0 50.0 50.0 50.0 73.0 50.0 71.0

60 rows × 21 columns

sub = submission_raw_df["id"]
sub = pd.concat([sub, results], axis=1)
sub.to_csv(predict_folder_path + "probspace_conv_simple.csv", header=True, index=None)

添付データ

  • probspace_conv_simple.ipynb?X-Amz-Expires=10800&X-Amz-Date=20240416T120022Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIP7GCBGMWPMZ42PQ
  • Favicon
    new user
    コメントするには 新規登録 もしくは ログイン が必要です。