일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 프로그래머스
- programmers
- Git
- Kaggle
- SW Expert Academy
- Baekjoon
- gs25
- 프로그래머스 파이썬
- 데이콘
- ubuntu
- 코로나19
- 캐치카페
- 편스토랑 우승상품
- 우분투
- dacon
- AI 경진대회
- Docker
- 파이썬
- 금융문자분석경진대회
- github
- 더현대서울 맛집
- 자연어처리
- 편스토랑
- leetcode
- PYTHON
- 맥북
- Real or Not? NLP with Disaster Tweets
- ChatGPT
- 백준
- hackerrank
- Today
- Total
목록
반응형
분류 전체보기 (1651)
솜씨좋은장씨
In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice as much as every other number in the array. If it is, return the index of the largest element, otherwise return -1. Example 1: Input: nums = [3, 6, 1, 0] Output: 1 Explanation: 6 is the largest integer, and for every other number in the array x, 6 is more th..
Given two strings A and B of lowercase letters, return true if you can swap two letters in A so the result is equal to B, otherwise, return false. Swapping letters is defined as taking two indices i and j (0-indexed) such that i != j and swapping the characters at A[i] and A[j]. For example, swapping at indices 0 and 2 in "abcd" results in "cbad". Example 1: Input: A = "ab", B = "ba" Output: tru..
소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 애플 이벤트를 시청하며 진행했던 13일차! 오늘도 역시 NIPA에서 지원받은 V100 GPU 서버를 활용하여 도전해보았습니다. 13일차는 12일차에서 열심히 전처리 했던 데이터를 바탕으로 시도해보았습니다. 왜냐하면 12일차에서는 결과를 도출하고 다 제출하고 나서야 전처리한 데이터를 활용하지 않았다는 것을 깨달았기 때문입니다. 여러 모델 중에서 가장 validation loss 가 좋아보이는 세개를 골라서 제출해보았습니다. Bi-LSTM, Baseline model, LSTM 모델을 활용해 보았습니다. 예전에 금융 문자 분석 경진대회에서는 LSTM 모델이 성능이 괜찮게 나왔었는데 아직 전처리 ..
Given an array of integers arr, a lucky integer is an integer which has a frequency in the array equal to its value. Return a lucky integer in the array. If there are multiple lucky integers return the largest of them. If there is no lucky integer return -1. Example 1: Input: arr = [2,2,3,4] Output: 2 Explanation: The only lucky number in the array is 2 because frequency[2] == 2. Example 2: Inpu..
소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 11월 애플 이벤트를 기다리면서 진행한 12일차! 이번엔 베이스라인 코드에서 벗어나서! 새로운 전처리방식과 모델을 활용해보기로 했습니다. 그 과정에서 아래의 링크를 참고하였습니다. 위키독스 온라인 책을 제작 공유하는 플랫폼 서비스 wikidocs.net 이번 시도도 NIPA에서 지원해준 수시사용자 지원 V100 GPU 환경에서 실시하였습니다. 올 초 금융문자분석경진대회에서는 Colab을 활용하였어서 런타임에 엄청 고통 받았었는데 덕분에 정말 편하게 대회를 진행하는 것 같습니다. 지원해주셔서 정말 감사드립니다. import pandas as pd import numpy as np import ..
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]). You are given a target value to search. If found in the array return true, otherwise return false. Example 1: Input: nums = [2,5,6,0,0,1,2], target = 0 Output: true Example 2: Input: nums = [2,5,6,0,0,1,2], target = 3 Output: false Follow up: This i..
Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it's main diagonal, switching the row and column indices of the matrix. Example 1: Input: [[1,2,3],[4,5,6],[7,8,9]] Output: [[1,4,7],[2,5,8],[3,6,9]] Example 2: Input: [[1,2,3],[4,5,6]] Output: [[1,4],[2,5],[3,6]] Note: 1
pandas를 활용하여 읽어온 csv 파일에서 특정 column에 대한 중복값을 제거하기 위하여 아래와 같이 먼저 파일을 엑셀에서 읽어온 후 import pandas as pd data = pd.read_excel("./42_nia_pqa_QueryTemplate.xlsx") data_fillna = data.fillna(0.0) data_fillna_dropna = data_fillna[data_fillna['property'] != 0.0] data_fillna_dropna.head() 특정 값 이외의 값만 남기기 위하여 위와 같이 코드를 실행하였으나 --------------------------------------------------------------------------- ValueErr..
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Note: You must not use any built-in BigInteger library or convert the inputs to integer directly. Example 1: Input: num1 = "2", num2 = "3" Output: "6" Example 2: Input: num1 = "123", num2 = "456" Output: "56088" Constraints: 1 123으로 바뀌게 됩니다. 그럼 이렇게 바꾼 숫자를 곱하고 s..
소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 소설 작가 분류 AI 경진대회 9일차! 9일차는 베이스라인 코드에서 좀 벗어나 다른 방법을 활용해보고자 했습니다. BERT와 같은 pre-trained 모델은 활용할 수 없지만 전처리 과정에서는 사전 학습을 사용해도 된다고 하여 Glove 임베딩을 활용하여 도전해보기로 했습니다. 방법은 아래의 위키독스에서 활용한 방법을 바탕으로 도전해보겠습니다. 위키독스 온라인 책을 제작 공유하는 플랫폼 서비스 wikidocs.net
Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1. After doing so, return the array. Example 1: Input: arr = [17,18,5,4,6,1] Output: [18,6,6,6,1,-1] Constraints: 1
소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 대회 커버가 바뀌어 뭔가 새로운 대회를 참가하는 것 같은 느낌의 도전 8일차 입니다. 먼저 fasttext로 결과를 도출해보고자 열심히 시도해보았으나 제 시간 내에 validation_loss 값을 0.78 아래로 떨어지는 것을 확인하지 못하여 이번에도 아쉽지만 7일차에서 조금씩만 변형하여 도전해보았습니다. PorterStemmer로 어간추출 후 WordNetLemmatizer로 표제어 추출을 하여 나온 데이터를 바탕으로 시도해보았습니다. train_dataset = pd.read_csv("./train.csv") test_dataset = pd.read_csv("./test_x.csv") ..
Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1. Sort the elements of arr1 such that the relative ordering of items in arr1 are the same as in arr2. Elements that don't appear in arr2 should be placed at the end of arr1 in ascending order. Example 1: Input: arr1 = [2,3,1,3,2,4,6,7,9,2,19], arr2 = [2,1,4,3,9,6] Output: [2,2,2,1,4,3,3,9,..
소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 7일차! 7! 뭔가 행운이 찾아올 것 같은 기분이 들었던 7일차 도전의 날이었습니다. 오늘도 역시 aihub에서 지원받은 GPU서버 환경에서 진행하였습니다. 오늘은 생각보다 시간이 없어서 원래는 Glove 임베딩을 활용해서 결과를 내보려했지만 잠시 뒤로 미뤄두고 표제어추출도 활용해보고 학습데이터에서 validation 데이터를 비율을 줄여보기도하고 이것저것 여러 하이퍼 파라미터를 변경해보면서 시도해보았습니다. 첫번째 시도해 보았던 것은 앞의 전처리 과정은 6일차와 동일하고 가장 좋았던 모델에서 임베딩 차원만 128 -> 256 으로 변경하여 시도해보았습니다. 여러 시도 중에 가장 valida..
Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time. Return that integer. Example 1: Input: arr = [1,2,2,6,6,6,6,7,10] Output: 6 Constraints: 1
소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 소설 작가 분류 AI 경진대회 7일차! 7! 뭔가 기분좋아지는 숫자입니다. 이번 대회에서는 BERT와 같은 사전학습 모델 사용이 불가합니다. 그런데 전처리 과정에서는 사용을 해도 된다고하여 정보의 보고인 Kaggle로 향하여 Glove 임베딩을 활용한 노트북을 찾아 따라해보기로 하였습니다. 모든 개발은 aihub에서 지원 받은 GPU 서버 환경에서 진행하였습니다. 일반 수시 사용자에게도 아낌없이 지원해주셔서 정말 감사합니다. NLP using GloVe Embeddings(99.87% Accuracy) Explore and run machine learning code with Kaggle ..
최근 약 3만개의 한글파일을 첫페이지를 이미지로 500x707크기의 썸네일을 만들어야하는 일이 있었습니다. 30개의 파일이었으면 귀찮더라도 그냥 모든 파일을 하나하나 열어서 첫 페이지를 이미지로 저장하게끔 하였겠지만 3만개의 파일을 하나하나 열어서 하기에는 너무 많은 양이 었습니다. 저는 이를 파이썬으로 코드를 작성하여 한번에! 촤르륵 실행해보기로 하였습니다. 파이썬을 배우고 나서부터는 이런 대량의 파일을 다루는 작업이나 단순 반복 작업, 수많은 파일 속에서 하나의 파일 찾기와 같은 작업을 주로 파이썬을 활용하여 진행하게 되는 것 같습니다. 진행한 환경은 Windows 10 + 한글 2018 + Python3,7 ( pywin32 라이브러리 ) 에서 진행하였습니다. 이 작업을 진행하기 위해서는 무조건! ..
from konlpy.tag import Mecab mecab = Mecab() print(mecab.pos("솜씨좋은장씨의 개발블로그")) 최근 Google Colab에서 mecab에 사용자 사전을 추가하는 방법에 대해서 문의 하시는 분이 많기도 하셨고 저도 mecab에서 사용자 사전을 추가하여 사용해야하는 경우가 생겨 작성해보았습니다. 2023.04.22 - [머신러닝 | 딥러닝/자연어처리] - Google Colab에서 mecab-ko-dic 사용자 사전 추가하기! (2023년 업데이트 버전)
소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 소설 작가 분류 AI 경진대회 6일차! 오늘도 퇴근 후 즐거운 DACON 도전의 시간이 다가왔습니다. 오늘은 전처리 방법에서 Stemmer를 LancasterStemmer 에서 Porterstemmer로 바꾸고 임베딩 차원을 16 -> 128로 늘렸습니다. import pandas as pd import re train_dataset = pd.read_csv("./train.csv") test_dataset = pd.read_csv("./test_x.csv") 먼저 데이터를 불러옵니다. from nltk.corpus import stopwords def alpha_num(text): retu..
한글 파일에서 첫 페이지만 bmp로 저장한 다음 bmp 파일을 작은 해상도로 resizing 한 후 jpeg로 저장하는 과정에서 이미지가 깨져서 보이는 현상이 있었습니다. 처음에는 한글 API 가 제대로 동작하지 않아서인가 싶었지만 PIL(Pillow) 라이브러리에서 resize 하는 과정에서 발생하는 문제였습니다. 해결 방법 해결하는 방법은 아주 간단했습니다. img = Image.open("./test.bmp").convert("RGB") new_img = img.resize((500, 707), Image.ANTIALIAS) new_img.save("./test.jpg", format='jpeg', quality=100) resize를 하는 과정에서 Image.ANTIALIAS 라는 인자를 넣어주면..
Given a m * n matrix of distinct numbers, return all lucky numbers in the matrix in any order. A lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column. Example 1: Input: matrix = [[3,7,8],[9,11,13],[15,16,17]] Output: [15] Explanation: 15 is the only lucky number since it is the minimum in its row and the maximum in its column Example 2..
소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 소설 작가 분류 AI 경진대회 5일차! 요즘 오랜만에 NLP 대회가 열려 퇴근 후가 즐거운 나날입니다. 오늘은 전처리 방법을 바꾸고 베이스라인 코드에있는 모델을 활용하여 결과를 도출해보았습니다. 모든 과정은 aihub에서 지원받은 GPU 환경에서 진행하였습니다. 먼저 첫 번째로 전처리 방식에서 아주 작은 변화를 주었습니다. 먼저 영어 대문자 소문자만 제거해주는 alpha_num 함수에 stopwords에 ' 이 포함되어있는 것들이 alpha_num을 거쳤을때 '이 삭제되지 않아 you've 같은 불용어가 제대로 제외되도록 \' 를 추가했습니다. def alpha_num(text): retur..
공모전 링크 COMPAS COMPAS compas.lh.or.kr 최근 idEANS 팀원들과 함께 진행하다가 여러 사정으로 인하여 최종 제출은 하지 못한 LH COMPAS 광양시 전기자동차 충전소 최적입지 선정 공모전 활동기입니다. 각 글의 내용은 자료조사를 진행했던 내용과 제공 받은 데이터를 Python을 활용하여 데이터를 가공해본 내용을 포함하고 있습니다. 글이 비공개로 되어있던 것을 발견하여 공개로 전환해두었습니다. 데이터 EDA [COMPAS 광양시] 공모전 제공 데이터 살펴보기 데이터 분석 활용 시간 2020년 9월 20일 15시 ~ 19시 ( 총 4시간 소요 ) 광양시 충전소 설치 현황 ( 01.광양시_충전기설치현황.csv ) 전기차 충전소 모니터링 www.ev.or.kr import pand..
Given a m * n matrix grid which is sorted in non-increasing order both row-wise and column-wise. Return the number of negative numbers in grid. Example 1: Input: grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]] Output: 8 Explanation: There are 8 negatives number in the matrix. Example 2: Input: grid = [[3,2],[1,0]] Output: 0 Example 3: Input: grid = [[1,-1],[-1,-1]] Output: 3 Example 4: ..
소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 소설 작가 분류 AI 경진대회 4일차! 오늘은 먼저 DACON 에서 제공해주는 베이스라인을 먼저 시도해보았습니다. 개발은 NIPA에서 지원받은 GPU 서버환경에서 진행하였습니다. 소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io import pandas as pd import warnings warnings.filterwarnings(action='ignore') import numpy as np import tensorflow as tf from tensorflow.keras.preprocessing.sequence impor..
업무 중 NER을 담당하는 분께 NER을 활용하여 특정 태스크에 대해서 테스트를 요청드렸었고 결과로 받은 파일은 'INPUT : 롤플레잉 게임 시스템 쇼크를 개발한 회사는\n', "GOLD : ['O', 'O', 'B-SUB', 'I-SUB', 'O', 'O']\n", "PRED : ['B-EXP', 'I-EXP', 'B-SUB', 'I-SUB', 'O', 'O']\n", 'CONF : [0.99205834 0.99542373 0.9999639 0.999987 0.99999595 0.9999968 ]\n', 이렇게 NER을 거쳐 나온 결과들이 string 형식으로 한줄한줄 적혀 있는 txt 파일 형식이었습니다. 여기서 NER 모델이 예측해서 뽑아낸 결과를 B-SUB, I-SUB, B-EXP, I-EXP를..
이번 NIPA 서버 반납 전 백업을 위해 그동안 서버에서 진행했던 여러 파일들을 압축파일로 만든 후에 다운로드 받아 외장하드에 저장해두기 위해 우분투에서 zip 파일로 압축하는 방법을 알아보게 되었습니다. 먼저 zip 이 설치되어있지 않으면 아래와 같은 메세지를 만나게 됩니다. The program 'zip' is currently not installed. You can install it by typing: sudo apt install zip 이는 메세지에 나온대로 아래의 명령어를 통하여 설치해주면 됩니다. $ sudo apt install zip zip 명령어의 설명은 zip --help를 통해 알 수 있습니다. $ zip --help Copyright (c) 1990-2008 Info-ZIP -..
The Tribonacci sequence Tn is defined as follows: T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >= 0. Given n, return the value of Tn. Example 1: Input: n = 4 Output: 4 Explanation: T_3 = 0 + 1 + 1 = 2 T_4 = 1 + 1 + 2 = 4 Example 2: Input: n = 25 Output: 1389537 Constraints: 0
소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io DACON에서 금융문자 분석 경진대회 이후 오랜만에 NLP대회가 열렸습니다. 이 글에서는 첫날, 두번째날, 세번째날 시도해본 내용을 적어보려합니다. 이 3일간에는 별다른 EDA 없이 그저 기존에 해보던 방법과 베이스라인을 참고하고 간단한 전처리만 활용하여 시도해보았습니다. 개발환경은 NIPA에서 지원받은 GPU서버를 활용하여 진행하였습니다. 먼저 첫 날! import pandas as pd train_dataset = pd.read_csv("./train.csv") test_dataset = pd.read_csv("./test_x.csv") 먼저 제공받은 학습데이터를 pandas를 활용하여 ..
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is, F(0) = 0, F(1) = 1 F(N) = F(N - 1) + F(N - 2), for N > 1. Given N, calculate F(N). Example 1: Input: 2 Output: 1 Explanation: F(2) = F(1) + F(0) = 1 + 0 = 1. Example 2: Input: 3 Output: 2 Explanation: F(3) = F(2) ..