일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- ChatGPT
- 편스토랑 우승상품
- dacon
- 파이썬
- 프로그래머스 파이썬
- Kaggle
- 맥북
- 금융문자분석경진대회
- Git
- gs25
- Docker
- programmers
- SW Expert Academy
- 더현대서울 맛집
- leetcode
- AI 경진대회
- ubuntu
- 편스토랑
- github
- hackerrank
- PYTHON
- 데이콘
- 프로그래머스
- 캐치카페
- Real or Not? NLP with Disaster Tweets
- 우분투
- 백준
- Baekjoon
- 코로나19
- 자연어처리
- Today
- Total
목록
반응형
2020/10 (33)
솜씨좋은장씨
소설 작가 분류 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 요즘 여러 사정으로 인하여 다른 공모전 참가도 제대로 못하고 결과물 제출도 하지 못하였습니다. 어느 정도 정리를 하고 둘러보던 중 DACON에서 드디어 NLP대회가 오픈하여 이번엔 그동안 여러 공모전을 도전하며 듣고 보고 해보았던 노하우를 녹여보고자 합니다. 데이터는 영어 데이터로 구성되어있습니다. 자연어처리에 관심 있는 분들은 도전해보셔도 좋을 것 같습니다. 상금으로는 100만원에 애플워치가 제공된다고 합니다. 공모전 진행은 NIPA에서 지원해주는 GPU를 지원받아 Ubuntu + V100 + TF2 환경에서 진행하였습니다. 비싼 GPU! 지원 받아 무료로 사용해보자! Ai Hub GPU ..
You are given a license key represented as a string S which consists only alphanumeric character and dashes. The string is separated into N+1 groups by N dashes. Given a number K, we would want to reformat the strings such that each group contains exactly K characters, except for the first group which could be shorter than K, but still must contain at least one character. Furthermore, there must..
Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute difference between i and j is at most k. Example 1: Input: nums = [1,2,3,1], k = 3 Output: true Example 2: Input: nums = [1,0,1,1], k = 1 Output: true Example 3: Input: nums = [1,2,3,1,2,3], k = 2 Output: false Solution class Solution: def..
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct. Example 1: Input: [1,2,3,1] Output: true Example 2: Input: [1,2,3,4] Output: false Example 3: Input: [1,1,1,3,3,4,3,2,4,2] Output: true Solution from collections import Counter class Solu..
인스타 그램 크롤링을 진행하기 위하여 오랜만에 Selenium으로 작성하여 사용하였던 코드를 가져와 크롤링을 시작하려고 하니 --------------------------------------------------------------------------- WebDriverException Traceback (most recent call last) in 271 # display.stop() 272 if __name__ == "__main__": --> 273 extract_insta_data() in extract_insta_data() 32 # driver = wd.Chrome("/home/ubuntu/somjang-utils/chromedriver", options=options) 33 --->..
Given a list of non-negative integers nums, arrange them such that they form the largest number. Note: The result may be very large, so you need to return a string instead of an integer. Example 1: Input: nums = [10,2] Output: "210" Example 2: Input: nums = [3,30,34,5,9] Output: "9534330" Example 3: Input: nums = [1] Output: "1" Example 4: Input: nums = [10] Output: "10" Constraints: 1
Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. The order of elements can be changed. It doesn't matter what you leave beyond the new length. Clarification: Confused why the returned value is an integer but your ..
Find all valid combinations of k numbers that sum up to n such that the following conditions are true: Only numbers 1 through 9 are used. Each number is used at most once. Return a list of all possible valid combinations. The list must not contain the same combination twice, and the combinations may be returned in any order. Example 1: Input: k = 3, n = 7 Output: [[1,2,4]] Explanation: 1 + 2 + 4..
Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? Solution # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reverseList(self, head: ListNode) -> ListN..
Given words first and second, consider occurrences in some text of the form "first second third", where second comes immediately after first, and third comes immediately after second. For each such occurrence, add "third" to the answer, and return the answer. Example 1: Input: text = "alice is a good girl she is a good student", first = "a", second = "good" Output: ["girl","student"] Example 2: ..
Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: "tree" Output: "eert" Explanation: 'e' appears twice while 'r' and 't' both appear once. So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer. Example 2: Input: "cccaaa" Output: "cccaaa" Explanation: Both 'c' and 'a' appear three times, so "aaaccc" is also a valid an..
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Example 1: Input: [3,2,1,5,6,4] and k = 2 Output: 5 Example 2: Input: [3,2,3,1,2,4,5,5,6] and k = 4 Output: 4 Note: You may assume k is always valid, 1 ≤ k ≤ array's length. Solution class Solution: def findKthLargest(self, nums: List[int], k: int) -> int:..
Given a non-empty array of integers, return the k most frequent elements. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] Example 2: Input: nums = [1], k = 1 Output: [1] Note: You may assume k is always valid, 1 ≤ k ≤ number of unique elements. Your algorithm's time complexity must be better than O(n log n), where n is the array's size. It's guaranteed that the answer is unique, in o..
Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twice in this array. Could you do it without extra space and in O(n) runtime? Example: Input: [4,3,2,7,8,2,3,1] Output: [2,3] Solution from collections import Counter class Solution: def findDuplicates(self, nums: List[int]) -> List[int]: cnt_items = ..
Given an integer, return its base 7 string representation. Example 1: Input: 100 Output: "202" Example 2: Input: -7 Output: "-10" Note: The input will be in range of [-1e7, 1e7]. Solution class Solution: def convertToBase7(self, num: int) -> str: if num == 0: return str(num) sign = 1 if num < 0: sign = -1 num = abs(num) answer = '' while num: answer = str(num % 7) + answer num //= 7 return ('-' ..
$ bash
심리 성향 예측 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 3일차 4일차에 시도해본 내용을 정리한 글입니다. 3일차에는 tensorflow를 활용하여 결과를 내보기로 했습니다. import numpy as np import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.layers import Dense from tensorflow.keras.utils import to_categorical from tensorflow.keras import metrics from tensorflow.keras import optimizers from tensorflow...
Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn]. Return the array in the form [x1,y1,x2,y2,...,xn,yn]. Example 1: Input: nums = [2,5,1,3,4,7], n = 3 Output: [2,3,5,4,1,7] Explanation: Since x1=2, x2=5, x3=1, y1=3, y2=4, y3=7 then the answer is [2,3,5,4,1,7]. Example 2: Input: nums = [1,2,3,4,4,3,2,1], n = 4 Output: [1,4,2,3,3,2,4,1] Example 3: Input: nums =..
An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Example: Input: 38 Output: 2 Explanation: The process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it. Follow up: Could you do it without any loop/recursion in O(1) runtime? Solution class Solution: def addDigits(self, num: int) -> int: while True: if num // 10 < 1: return n..
ner 관련 작업을 진행하기 위하여 여러 라이브러리를 설치하는 과정에서 $ pip install transformers 위의 명령어를 활용하여 설치하려고 하였을 때 (pytorch_new_p36) ubuntu@nipa2020-0000:~$ pip install transformers Looking in indexes: http://ftp.daumkakao.com/pypi/simple Collecting transformers Downloading http://mirror.kakao.com/pypi/packages/19/22/aff234f4a841f8999e68a7a94bdd4b60b4cebcfeca5d67d61cd08c9179de/transformers-3.3.1-py3-none-any.whl (1.1 ..
Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right. Note that elements beyond the length of the original array are not written. Do the above modifications to the input array in place, do not return anything from your function. Example 1: Input: [1,0,2,3,0,4,5,0] Output: null Explanation: After calling your function, the inp..
pip install tensorflow-gpu conda install tensorflow-gpu 위의 명령어를 통해 tensorflow gpu버전을 설치한 이후에 제대로 GPU를 제대로 인식하는 방법은 다음과 같습니다. 먼저 설치가 제대로 되었는지 import를 해보고 오류가 나는지 안나는지 확인해봅니다. import tensorflow as tf 설치한 텐서플로우의 버전을 확인해봅니다. tf.__version__ '2.2.0' 여기까지 별다른 오류없이 잘 진행되었다면 아래의 코드를 통해 GPU 사용가능 여부를 확인하면 됩니다. from tensorflow.python.client import device_lib device_lib.list_local_devices() [name: "/device:C..
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. Example 1: Input: digits = "23" Output: ["ad","ae","af","bd","be","bf","cd","ce","cf"] Example 2: Input: digits = ""..
논문 : Novel Keyword Extraction & Language Detection Approaches Papers with Code - Keyword Extraction paperswithcode.com 영어 단어 뜻 비고 Fuzzy string matching 퍼지 검색 알고리즘 유사성 검색 알고리즘 철자검사기와 구글과 얀덱스의 완성된 검색엔진의 근본을 이루고 있음. 검색엔진에서 당신은 ...을 말하려고 하는가요? 라는 함수를 제공하는데 이용되어왔음. bit.ly/30uQXNC
Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] Output: [2,2] Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Output: [4,9] Note: Each element in the result should appear as many times as it shows in both arrays. The result can be in any order. Follow up: What if the given array is already sorted? How would you optimize ..
DACON 심리 성향 예측 AI 경진대회를 진행하면서 데이터 속 몇 개의 column을 일반 값에서 정수로 숫자를 변경한 이후에 이를 LGBMClassifier에 넣고 model.fit을 실행하려고 하니 ValueError: DataFrame.dtypes for data must be int, float or bool. Did not expect the data types in the following fields 위와 같은 오류가 발생하며 진행이 되지 않았습니다. 이를 해결하는 방법은 다음과 같습니다. train_x['gender'] = pd.to_numeric(train_x['gender']) 판다스의 to_numeric을 활용하여 데이터 타입을 변경해주면 됩니다. 읽어주셔서 감사합니다.
심리 성향 예측 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 심리성향 예측 AI 경진대회 2일차! 오늘은 먼저 지난번에 GridSearchCV를 통해 얻은 최적의 파라미터 값을 바탕으로 결과를 내보기로 했습니다. 너무 욕심을 많이 부려서 너무 많은 파라미터를 넣은 탓인지 최적의 파라미터를 도출하는데까지 약 23시간의 시간이 소요되었습니다. GridSearchCV에 관한 코드는 지난 1일차 게시물에 포함되어있습니다. 23시간이 소요된 끝에 얻은 파라미터는...! Fitting 5 folds for each of 5460 candidates, totalling 27300 fits [Parallel(n_jobs=1)]: Using backend Sequen..
Implement a MyCalendar class to store your events. A new event can be added if adding the event will not cause a double booking. Your class will have the method, book(int start, int end). Formally, this represents a booking on the half open interval [start, end), the range of real numbers x such that start
Given two positive integers n and k. A factor of an integer n is defined as an integer i where n % i == 0. Consider a list of all factors of n sorted in ascending order, return the kth factor in this list or return -1 if n has less than k factors. Example 1: Input: n = 12, k = 3 Output: 3 Explanation: Factors list is [1, 2, 3, 4, 6, 12], the 3rd factor is 3. Example 2: Input: n = 7, k = 2 Output..