Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import pickle
- import catboost
- class Solver:
- def __init__(self):
- pd.options.mode.chained_assignment = None
- self.ship = None
- self.logs = None
- with open(__file__[:-7] + "model.pkl", "rb") as f:
- self.model = pickle.load(f)
- def new_mission(self, ship):
- self.ship = ship.drop(columns=["ship_id"])
- self.logs = []
- def append_predict(self, log):
- for cl in self.ship.columns:
- log.loc[:, cl] = self.ship.loc[:, cl]
- self.logs.append(log)
- return max(1, self.model.predict(log)[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement