목록전체 글 (258)
Joonas' Note
문제 이번 문제는 문제적남자 4화에 나온 뇌풀기문제이다. 6개의 9를 사용해서 100을 만드는 수식을 찾는 문제인데, DFS로 모든 경우의 수를 탐색하면 되는 전형적인 문제로 보인다. 숫자들 사이에 수식을 끼워 모든 경우의 수를 만들어보고, 파이썬의 eval 함수로 계산한 결과가 100 이 되는 경우만 세어보면 될 것 같다. 9와 사칙연산만 사용하기 6개의 9 사이마다 사칙연산을 끼워넣어서 100이 만들어지는 경우를 찾아본다. 4개의 연산자를 5개의 공간에 끼워넣으므로 경우의 수는 \(4^5 = 1024\) 가지밖에 되지 않는다. 정답은 12개로 생각보다 많은데, 이건 순열이 달라서 세어진 것이고 조합으로 보면 단 하나이다. (정답 아래에 적음) 정답 9+9+9/9+9*9 = 100.0 9+9+9*9+9..
Dataset https://www.kaggle.com/datasets/joonasyoon/file-format-detection Programming Laungages and File Format Detection can you know what file format is? and written in which language? www.kaggle.com Code https://www.kaggle.com/code/joonasyoon/ml-content-based-file-format-detection [ML] 💾 Content-based File Format Detection 📃 Explore and run machine learning code with Kaggle Notebooks | Using d..
압축 파일을 압축 해제하려고 아래처럼 unzip을 실행했는데 에러가 났다. $ unzip dataset.zip -d data Archive: dataset.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of dataset.zip or ..
https://github.com/pytorch/pytorch/issues/16417 RuntimeError: CUDA out of memory. Tried to allocate 12.50 MiB (GPU 0; 10.92 GiB total capacity; 8.57 MiB already allocated; 9.28 CUDA Out of Memory error but CUDA memory is almost empty I am currently training a lightweight model on very large amount of textual data (about 70GiB of text). For that I am using a machine on a c... github.com 대부분 아래 메시..
2021.02.06 - 백준 온라인 저지(BOJ) 기능 확장 프로그램 백준 온라인 저지(BOJ) 기능 확장 프로그램 백준 온라인 저지(https://www.acmicpc.net) 사이트의 기능을 보완/확장하는 목적으로 BOJ-Extended를 만들었다. BOJ Extended 백준 온라인 저지(BOJ)를 확장된 기능과 함께 사용해보세요. chrome.google.com 처음.. blog.joonas.io 나만의 기능을 원해서 1월에 작게 개발하고, 2월에 배포하기 시작했던 확장 프로그램이었는데, 다같이 자기가 필요한 기능을 만들어봤으면 좋겠어서 오픈소스로 공개하고 관리한 지 벌써 1년이 지났다. 1.7.7 버전 이후로는 stable한 상태이다. 어느 순간부터 Chrome 정책이 Manifest V3 업데..
Numeric Error 결과값이나 학습 도중에 log(x)를 씌우면 NaN으로 가는 경우. 즉, x가 음수가 나오는 경우가 있는 지? log1p 등으로 해결할 수도 있지만 계산 과정에서 음수가 나오지 않는지 수식을 다시 확인한다. Learning rate learning rate가 커서 gradient discent 단계에서 아예 튕겨져 나갔을수도 있다. 데이터셋에 NaN이 섞인 경우 왜인지 모르겠는데 종종 pandas에서 fillna()가 먹히지 않는 경우가 있었다. 아래 스크립트로 N/A, NaN 등의 값이 있는 지 확인한다. def get_na_df(df): na_df = df.isna().sum() na_cols = na_df[na_df > 0].index return df[df.isna().a..
이번 글에서 사용되는 데이터셋은 Kaggle의 한 Competition인 house-prices-advanced-regression-techniques이다. 개와 고양이 분류 이후로, 회귀(Regression) 모델을 연습하기 위해서 적당한 주제를 잡던 중에 먼저 ML 모델로 데이터 전처리(preprocessing)부터 연습하기로 했다. Regression 모델로 LinearRegression, Ridge, Lasso 이렇게 3개로 학습하면서 튜닝해봤는데, LightGBM이 가장 loss가 낮아서 그걸로 제출했더니 가장 순위가 좋았다. 그래도 RMSE 0.17812(상위 77%)로 매우 낮은 예측을 보였다. https://www.kaggle.com/code/joonasyoon/ml-practice-on-..
Pandas는 기본값이 64비트 타입임에 유의해야한다. ╔══════════════════════════╦════════════════╦════════════════════╦═════════════════════════╦═════════╦═════════╗ ║ Data type ║ dtype ║ CPU tensor ║ GPU tensor ║ NumPy ║ Pandas ║ ╠══════════════════════════╬════════════════╬════════════════════╬═════════════════════════╬═════════╣═════════╣ ║ Boolean ║ torch.bool ║ torch.BoolTensor ║ torch.cuda.BoolTensor ║ bool_ ║ ..