본문 바로가기

전체 글267

1441. Build an Array With Stack Operations class Solution: def buildArray(self, target: List[int], n: int) -> List[str]: ls = list(range(1, n+1)) ans = [] for i in range(n): if ls[i] in target: ans.append("Push") else: ans.append("Push") ans.append("Pop") return ans 헤맷던 점은 target list와 매칭을 어떻게 시켜야할지 잘 안되서 discussion에 가서 다른 사람 풀이를 보니 list를 하다 더 만들어서 매칭시킴 여기서 한 가지 더 조건이 있었어야 되는데 test case가 [1,2] 4 일때 이미 target과 매칭이 끝났을때 stack을 멈추고 리턴하는걸 넣어.. 2020. 7. 1.
1021. Remove Outermost Parentheses STACK 말그대로 outermost parentheses를 제거하고 남은 string을 출력하는 문제 cnt 변수를 활용해서 list에 append하는 조건을 만들어서 해결 class Solution: def removeOuterParentheses(self, S: str) -> str: res = [] check = 0 for s in S: if s == "(" : check += 1 if check > 1 : # checking if it starts new paren or already added to "res" list res.append(s) if s == ")": check -= 1 if check >= 1: res.append(s) return "".join(res) 잘 안될때는 노트에 t.. 2020. 6. 30.
[PUBG] ML_baseline(lightgbm) Summary from outlier¶ headshotrate > 0.5 damagedealt >= 4000 kills > 60 killstreak > 10 walkdistance > 7.5k weaponacquired > 20 heals > 40 boosts > 20 totaldistance == 0 & kills > 0 walkdistance == 0 & kills > 0 ridedistance == 0 & roadkills > 0 weaponacquired == 0 & winplaceperc > 0.5 heals == 0 & winplaceperc > 0.8 heals and boosts == 0 & winplaceperc > 0.8 one NaN in target value In [2]: impo.. 2020. 6. 2.
[PUBG] Detecting Outliers Detecting Outliers¶ 1. Head Shot¶ For many users, high head shot rate is almost impossible. Even professional online fps gamers hard to exceed 30%. headshotkills/kills = headshot_rate 2. Damagedealt¶3. kills¶4. killstreaks¶5. longestkill¶ As fas as I know, 1km kill is very hard to achieve. 6. rankpoints(elo-like ranking)¶7. revives¶8. roadkills¶9. swimdistance¶10. teamkills¶ For detecting abuser.. 2020. 6. 2.
[PUBG] EDA In [1]: import os, time, gc import pandas as pd, numpy as np from tqdm import tqdm In [2]: os.listdir('input') Out[2]: ['sample_submission_V2.csv', 'test_V2.csv', 'train_V2.csv'] In [3]: %%time tr = pd.read_csv("input/train_V2.csv") te = pd.read_csv("input/test_V2.csv") Wall time: 13.1 s In [4]: tr.head() Out[4]: Id groupId matchId assists boosts damageDealt DBNOs.. 2020. 5. 29.
[tabnet] beating tablet data with deep learning github.com/dreamquark-ai/tabnet dreamquark-ai/tabnet PyTorch implementation of TabNet paper. Contribute to dreamquark-ai/tabnet development by creating an account on GitHub. github.com www.youtube.com/watch?v=ysBaZO8YmX8&feature=youtu.be data-newbie.tistory.com/377 TABNET: ATTENTIVE INTERPRETABLE TABULAR LEARNING -1 https://github.com/google-research/google-research/tree/master/tabnet https://ar.. 2020. 5. 28.