Algorithm description
1. K-Means
- Unsupervised learning
- It studies data without label.
- It is often used to find the hidden structure in the data.
- Unsuvervised learning itself can be the purpose. (news, shopping)
- It can be the preprocessing step of Unsupervised learning.
- Clustering itself can be a label.
K-means clustering
- We want to divide the data into k clusters. K is arbitrary number that we chose.
- Centroid is the center of the each cluster. There are K centroids.
- Centroid can be chosen randomly in the data which we already have. It is not good to initialize all centroids to the same value.
- Normalization is needed, since it uses Euclidean distance. (If one variable is way too big then other variable cannot affect the result.)
- z normalization : (x-mean(x))/sigma
- min max normalization: (x- xmin)/ (x max – x min)
Process
1. Random 한 값으로 centroid 를 잡아준다.
2. 각각의 자료 값이 어떤 centroid 에 가까운지 그룹 지어준다.
3. 그룹끼리 mean 좌표를 다시 잡아준다.
4. 이 mean 값들과 자료 값들과의 거리를 다시 측정해서, 다시 그룹지어준다.
5. mean 값들이 변하지 않을 때까지 반복해준다.
2. KNN
3. recommendation system using KNN
Content based filtering
-컨텐츠에 기반해서, 사용자가 어떤 것을 좋아하는지 판단하고 추천해주는 시스템이다.
한계
- 컨텐츠마다, 어떤것이 의미있는지 정해줘야한다.
- 퀄리티 측면에서는 떨어질 수 있다.
-새롭고 다양한 아이템을 잘 추천하지 않는다.
Collaborative filtering
-memory based CF/model based CF 가 있다.
: 특정한 structure 가지고 있지만, 다 똑같지는 않다.
MEMORY BASED CF:
아이템에 대해, 사용자의 RATING 을 추측할 때, 비슷한 유저나 아이템의 정보를 이용하는 것이다.
MODEL BASED CF:
아이템에 대해, 사용자의 RATING 을 추측할 때, 모델을 만들어 그 모델에 의해 추측하는 것이다. (CLUSTERING 같은)
- 신상은 추천 못해준다.
cold start problem ( 시작할 때 문제가 생긴다.)
--> 노출을 시킨다.
--> 평가단 활용
- 계산이 비싸다.
knn 이니까, centroid 찾을 때도...
한번 추천해주는데 계산이 ..
미리 계산해놓기 어렵. 실시간으로 값이 많이 바뀌기 때문에.
computationally expensive = not scalable( 데이터가 커져도 할 수 있는 알고리즘이 아니다)
데이터 커지면, 느려서 못쓴다.
유사도 측정
Item based CF
K =n
아이템끼리의 유사성을 본다. 가장 유사한 아이템 n개를 정한다.
그리고, 한 아이템에 대해서, 사용자가 구매한 아이템이 몇 개인지보고, 그거에 대한 상관성을 계산해준다.