목록Artificial Intelligence (7)
what i learned
추천시스템은 크게 콘텐츠기반 필터링과 협업 필터링으로 나뉘게 된다. [ML] 추천시스템 추천시스템은 크게 콘텐츠 기반 필터링과 협업 필터링으로 나뉜다. 1️⃣ 콘텐츠 기반 필터링 2️⃣ 협업 필터링 ◎ 최근접 이웃 협업 필터링(=메모리 협업 필터링) - 사용자 기반 - 아이템 기반 enddl3224.tistory.com 그 중 협업 필터링인 잠재요인 기반의 협업 필터링에 대해 자세히 공부하려고 한다. 잠재요인 협업필터링이란? 명확하게는 알 수 없는 잠재요인(factor)를 기준으로 테이블을 2개로 나누어 두 행렬을 내적의 곱을 통한 예측값을 생성하는 방식이다. 마치 이차방정식 ax^2 + bx + c를 (Ax+B)(Cx+D) 처럼 나누는 것이다. 행렬에선 연산을 하는게 복잡하지만 간단하게 말하면 원본행렬..
추천시스템은 크게 콘텐츠기반 필터링과 협업 필터링으로 나뉘게 된다. [ML] 추천시스템 추천시스템은 크게 콘텐츠 기반 필터링과 협업 필터링으로 나뉜다. 1️⃣ 콘텐츠 기반 필터링 2️⃣ 협업 필터링 ◎ 최근접 이웃 협업 필터링(=메모리 협업 필터링) - 사용자 기반 - 아이템 기반 enddl3224.tistory.com 그 중 협업 필터링인 아이템 기반 최근접 이웃 협업 필터링에 대해 자세히 공부하려고 한다. 최근접 이웃 필터링은 아이템 기반과 사용자 기반이 있는데, 아이템A를 좋아하는 사용자A가 아이템B를 좋아한다고 해서 아이템A를 좋아하는 사용자B에게 아이템B를 추천하여 사용자가 좋아할 확률보다 아이템A를 구매한 사용자B에게 다른 사용자들이 선호했던 아이템B를 추천하는 편이 더 정확도가 높을 것이다...
코사인 유사도란? 두 벡터 사이의 사잇각을 구해서 두 벡터값이 서로 얼마나 유사한지 수치로 확인하는 방법이다. 위의 그림처럼 유사한 벡터들 사이의 ⍬값을 구하여 cos⍬값이 작을수록 유사한 벡터라는 것을 알 수 있다. 벡터에서 cos⍬값을 구하는 방법은 벡터 내적을 연산하는 공식을 통해 유추할 수 있다. 두 벡터A, B에 대해 내적을 수행하는 공식은 두 벡터 A, B의 크기와 cos⍬값을 곱하여 나타낸다. 위 수식을 cos⍬에 대해 풀어보면, 이러한 수식을 얻을 수 있다. 즉, cos⍬는 두 벡터의 내적을 총 벡터의 크기의 합으로 나눈 것이다. 그렇다면 유사도를 측정하는데 코사인유사도를 사용하는 이유는 무엇일까? 희소행렬에서의 유사도 측정 결과값이 다른 방법(유클리드 거리 기반 지표 등)보다 정확도가 높..
추천시스템은 크게 콘텐츠 기반 필터링과 협업 필터링으로 나뉘게 된다. [ML] 추천시스템 "파이썬 머신러닝 완벽 가이드(권철민 저)" 추천시스템은 크게 콘텐츠 기반 필터링과 협업 필터링으로 나뉜다. 1️⃣ 콘텐츠 기반 필터링 2️⃣ 협업 필터링 ◎ 최근접 이웃 협업 필터링(=메모리 enddl3224.tistory.com 그 중 콘텐츠 기반 필터링에 대해 TMDB 5000 데이터셋을 가지고 자세히 설명하려고 한다. 콘텐츠 기반 필터링이란? 사용자가 영화를 감상한 후 감상했던 영화를 기반으로 비슷한 특성을 가진 다른 영화를 추천하는 시스템이다. 예를 들어, "알라딘"이라는 영화를 감상했다면 라는 공통특성을 가진 "라푼젤", "겨울왕국"과 같은 디즈니영화를 추천하게 되는 방식이다. 그렇기 때문에 영화에 대한 ..
추천시스템은 크게 콘텐츠 기반 필터링과 협업 필터링으로 나뉜다. 1️⃣ 콘텐츠 기반 필터링 2️⃣ 협업 필터링 ◎ 최근접 이웃 협업 필터링(=메모리 협업 필터링) - 사용자 기반 - 아이템 기반 ◎ 잠재 요인 협업 필터링 (with. 행렬 분해 기법) 1️⃣ 콘텐츠 기반 필터링이란? 사용자가 특정한 아이템을 매우 선호하는 경우, 그 아이템과 비슷한 콘텐츠를 가진 다른 아이템을 추천하는 방식이다. 영화 추천 시스템을 예로 들어보면, 사용자가 "컨택트"라는 영화에 평점 8점을 주고 "프로메테우스"라는 영화에 평점 9점을 줬다. "컨택트" 영화의 장르, 감독, 출연진 등의 정보와 "프로메테우스" 영화의 장르, 감독, 출연진의 정보를 파악하여 공통되는 장르나 감독, 출연진을 사용자에게 추천해주는 시스템이다. 즉..
[ML] Text Classification(1) - 텍스트 전처리 텍스트를 분석하기 위해 텍스트 토큰화 작업을 수행하고 feature를 추출한다. 텍스트 분석 수행 프로세스 텍스트 전처리 피처 벡터화/추출 ML 모델 수립 및 학습/예측/평가 이번 글은 전처리만 정 enddl3224.tistory.com 텍스트 전처리 과정이 끝났다면, 가공된 텍스트에서 Feature를 추출하고 벡터 값을 할당하여 모델을 수립하고 예측할 수 있도록 한다. Feature를 추출하여 벡터 값을 할당할 때 대표적인 방법으로 BOW(Bag Of Words)와 Word2Vec 방법이 있다. 이 중 BOW 방법으로 텍스트를 벡터화하겠다. BOW(Bag of Words) 문서가 가지는 모든 단어들을 문맥이나 순서를 무시하고 일괄적으로..
텍스트를 분석하기 위해 텍스트 토큰화 작업을 수행하고 feature를 추출한다. 텍스트 분석 수행 프로세스 텍스트 전처리 피처 벡터화/추출 ML 모델 수립 및 학습/예측/평가 이번 글은 전처리만 정리하고 벡터화 이후는 다음 글에 작성하겠다. 텍스트 토큰화 문장 토큰화 단어 토큰화 일반적으로 문장 토큰화는 각 문장이 가지는 시멘틱적인 의미가 중요할 때 사용하며 단어 토큰화는 구분자를 사용하여 단어를 토큰화할 수 있어서 BOW(Bag Of Words)와 같은 단어의 순서가 중요하지 않은 경우에 사용된다. 아래의 문장에 대해 토큰화 작업을 수행해보자. 💡 nltk 데이터 사용시 nltk.download()를 통해 데이터를 다운받을 수 있으며 최초 1번만 다운받는다. 자세한 정보는 nltk공식문서 import ..