전체 글 55

Classification_report

classification_report는 scikit-learn(sklearn)의 metrics 모듈에서 제공하는 분류 모델의 평가 지표를 출력해주는 함수이다. 실제 정답 구독 갱신 지속(1) 구독 갱신 취소(0) 예측 구독 갱신 지속(1) TP FP 구독 갱신 취소(0) FN TF from sklearn.metrics improt classification_report precision(정밀도) : 예측한 클래스 중 실제로 해당 클래스인 데이터의 비율 Recall(재현율) : 실제 클래스 중 예측한 클래스와 일치한 데이터의 비율 ▢ Precision 0 0으로 예측한 클래스 중 실제로 0인 데이터의 비율 41% 0으로 예측한 클래스 중 실제로 1인 데이터의 비율 59% ▢ Precision 1 1으로 ..

카테고리 없음 2023.11.27

객체탐지 - SSD(Single Shot MultiBox Detector)

SSD가 등장하게 된 배경 R-CNN 계열의 2-stage detector은 region propsal와 같은 다양한 view를 모델에 제공하여 높은 정확도를 보여준다. 하지만 region proposal를 추출하고 처리하는 과정에서 오랜 시간이 걸려 detection 속도가 느리다는 단점이 존재한다. 반면 YOLO v1은 원본 이미지 전체를 통합된 네트워크로 처리하기에 detection 속도가 빠르다. 하지만 grid cell 별로 2개의 bounding box만 선택하여 상대적으로 적은 view를 모델에 제공하여 정확도가 떨어진다. 이처럼 일반적으로 정확도와 detection 속도는 trade-off 관계에 있다. SSD는 다양한 view를 활용하면서 통합된 network 구조를 가진 1-stage ..

[LeetCode] - 보석과 돌

문제) J는 보석이며, S는 갖고 있는 돌이다. S에는 보석이 몇개나 있을까? 대소문자는 구분한다. https://leetcode.com/problems/jewels-and-stones/ Jewels and Stones - LeetCode Can you solve this real interview question? Jewels and Stones - You're given strings jewels representing the types of stones that are jewels, and stones representing the stones you have. Each character in stones is a type of stone you have. You want to kno leetcod..

카테고리 없음 2023.11.16

[LeetCode] - 상위 K 빈도 요소

https://www.youtube.com/watch?v=HraOg7W3VAM 이번 문제는 해시와 관련된 문제이다. 해시에 대해서 많은 글을 읽었지만, 자료구조에 취약한 나는 먼소리인가.. 머리가 어지럽던 와중에 10분만에 간단하고 바로 이해되게 해주는 영상을 만났다!! 문제) 풀이) import collections class Solution(object): def topKFrequent(self, nums, k): """ :type nums: List[int] :type k: int :rtype: List[int] """ answer = collections.Counter(nums).most_common(k) return [answer[i][0] for i in range(len(answer))] 유..

카테고리 없음 2023.11.16

[프로그래머스]- 기능개발

문제) https://school.programmers.co.kr/learn/courses/30/lessons/42586 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 입력 progresses = [93, 30, 55] , speeds = [1,30,5] 출력 [2,1] 풀이) 문제이해 첫 번째 기능은 93% 가 완료되어 있고 하루에 1%씩 작업이 가능하므로 7일간 작업 후 배포가 가능하다. 두 번째 기능은 30% 가 완료되어 있고 하루에 30% 씩 작업이 가능하므로 3일간 작업 후 배포가 가능하다. 하지만 이전 첫 번째 기능이 아직 완성된 상태가 아니기..

[LeetCode] - 일일온도(파이썬)

풀이) 매일의 화씨 온도 리스트 T를 입력받아서, 더 따뜻한 날씨를 위해서 며칠을 더 기다려야 하는지 출력하라. https://leetcode.com/problems/daily-temperatures/ Daily Temperatures - LeetCode Can you solve this real interview question? Daily Temperatures - Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer..

[LeetCode] - 유효한 괄호

문제) 괄호로 된 입력값이 올바른지 판별하라 https://leetcode.com/problems/valid-parentheses/ Valid Parentheses - LeetCode Can you solve this real interview question? Valid Parentheses - Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: 1. Open brackets must be closed by the sam leetcode.com ▶ 입력 [](){} ▶ 출력 true 풀이)..

[LeetCode] - 자신을 제외한 배열의 곱

문제) 배열을 입력받아 ouput[i]가 자신을 제외한 나머지 모든 요소의 곱셈결과가 되도록 출력하라 https://leetcode.com/problems/product-of-array-except-self/description/ Product of Array Except Self - LeetCode Can you solve this real interview question? Product of Array Except Self - Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. The product of..

[LeetCode] - 주식을 사고팔기 가장 좋은 시점

문제) 한 번의 거래로 낼 수 있는 최대 이익을 산출하라 https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/ Best Time to Buy and Sell Stock - LeetCode Can you solve this real interview question? Best Time to Buy and Sell Stock - You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and..