콘텐츠 기반 필터링의 한계를 해결하기 위해 협업 필터링에서는 사용자와 항목을 동시에 사용하여 추천을 제공합니다. 이렇게 하면 뜻밖의 추천 즉, 협업 필터링을 통한 모델은 사용자의 관심분야를 바탕으로 사용자 A에게 항목을 유사한 사용자 B가 있다고 가정해 봅시다. 또한 임베딩을 학습하여 특성 추출에 의존하지 않고 자동으로 처리됩니다
영화 추천 예시
학습 데이터가 10억 개 이상의 피드백 매트릭스로 만들 수 있습니다
각 행이 사용자를 나타냅니다.
각 열은 항목 (영화)을 나타냅니다.
영화에 대한 의견은 두 카테고리 중 하나에 속합니다.
음란한 가사: 사용자가 특정 영화를 좋아하는 정도를 지정합니다. 숫자 평점을 제공합니다.
암시적: 사용자가 영화를 시청하면 시스템은 사용자가 관심을 보임
단순화하기 위해 피드백 행렬이 바이너리라고 가정합니다. 즉, 특정 값 1은 영화에 대한 관심을 나타냅니다.
사용자가 홈페이지를 방문하면 시스템이 영화를 추천해야 합니다. 다음 두 가지를 기반으로 합니다.
사용자가 이전에 좋아요 표시한 영화와의 유사성
비슷한 사용자가 좋아한 영화
이해를 돕기 위해 영화의 몇 가지 특성을 수작업으로 제작해 보겠습니다. 다음 표에 설명되어 있습니다.
각 영화에 \([-1, 1]\) 의 스칼라를 할당한다고 가정해 보겠습니다. 아동용 영화인지 (음수 값) 또는 성인 (양수 값)인지를 나타냅니다. 또한 \([-1, 1]\) 의 각 사용자에게 특정 값을 설명하는 스칼라를 아동용 영화(-1에 가까울수록) 또는 성인에 대한 사용자의 관심 영화 (+1에 가까움)를 표시합니다. 영화 임베딩과 사용자의 곱 사용자가 예상하는 영화의 경우 임베딩이 더 높아야 합니다 (1에 가까움). 추가할 수 있습니다.
아래 다이어그램에서 각 체크 표시는 특정 영화를 상영하는 사용자가 시청했습니다. 세 번째와 네 번째 사용자는 세 번째 사용자는 어린이용 영화를 선호한다고 네 번째 사용자는 성인용 영화를 선호합니다. 하지만 첫 번째와 두 번째 사용자 이 기능 하나로는 선호도를 잘 설명하지 못합니다.
2D 임베딩
기능 하나로는 모든 사용자의 선호도를 설명하기에 충분하지 않았습니다. 극복하기 위해 두 번째 특성을 추가하겠습니다. 즉, 각 영화가 블록버스터나 예술 영화 등을 예로 들 수 있습니다. 두 번째 특성으로 이제 각 영화를 다음과 같은 2차원 임베딩으로 변환합니다.
사용자를 동일한 임베딩 공간에 다시 배치하여 각 (사용자, 항목) 쌍에 대해 사용자 임베딩의 내적과 항목 임베딩의 내적을 사용자가 영화를 보았을 때 1이 되고 그렇지 않은 경우에는 0이 됩니다.
이 예시에서는 임베딩을 직접 엔지니어링했습니다. 실제로 임베딩은 자동으로 학습할 수 있으며, 이는 협업 필터링의 모델을 학습시키는 작업도 반복해야 합니다 다음 두 섹션에서는 인코더-디코더 아키텍처를 학습하기 위한 임베딩과 학습 방법을 알아봅니다.
이 접근 방식의 협업적 특성은 모델이 임베딩을 학습합니다 영화의 임베딩 벡터가 고정되어 있다고 가정해 보겠습니다. 그런 다음 모델은 임베딩 벡터를 학습하여 사용자가 임베딩 벡터를 학습하여 사용자의 선호사항을 반영합니다. 결과적으로 선호도가 비슷한 사용자의 임베딩은 가까워집니다. 마찬가지로 사용자에 대한 임베딩이 수정되면 피드백 행렬을 가장 잘 설명하는 영화 임베딩을 학습할 수 있습니다. 비슷한 사용자가 좋아하는 영화를 퍼간 동영상도 임베딩을 학습합니다.
이해도 확인
사용자가 최근에 쇼핑 앱을 추천했기 때문에 모델이 이 사용자에게 쇼핑 앱을 추천합니다. 유사한 앱을 설치했습니다. 이것은 어떤 필터링의 예인가요?
콘텐츠 기반 필터링
잘하셨습니다. 콘텐츠 기반 필터링은 다른 사용자를 확인하지 않습니다.
협업 필터링
협업 필터링은 다른 사용자를 고려합니다. Google은 한 명의 사용자에게만 관심이 있습니다.
[null,null,["최종 업데이트: 2024-07-26(UTC)"],[[["\u003cp\u003eCollaborative filtering leverages similarities between users and items to provide recommendations, unlike content-based filtering.\u003c/p\u003e\n"],["\u003cp\u003eThis method allows for serendipitous recommendations by suggesting items based on the preferences of similar users.\u003c/p\u003e\n"],["\u003cp\u003eCollaborative filtering models can automatically learn embeddings, eliminating the need for manual feature engineering.\u003c/p\u003e\n"],["\u003cp\u003eThese embeddings represent users and items in a shared space where their proximity reflects similarity and preference.\u003c/p\u003e\n"],["\u003cp\u003eTraining these models involves optimizing embeddings to align with user feedback, bringing similar users and preferred items closer together in the embedding space.\u003c/p\u003e\n"]]],[],null,["# Collaborative filtering\n\nTo address some of the limitations of content-based filtering,\ncollaborative filtering uses *similarities between users and\nitems simultaneously* to provide recommendations. This allows\nfor serendipitous recommendations; that is, collaborative filtering\nmodels can recommend an item to user A based on the interests of\na similar user B. Furthermore, the embeddings can be learned\nautomatically, without relying on hand-engineering of features.\n\nMovie recommendation example\n----------------------------\n\nConsider a movie recommendation system in which the training data consists\nof a feedback matrix in which:\n\n- Each row represents a user.\n- Each column represents an item (a movie).\n\nThe feedback about movies falls into one of two categories:\n\n- **Explicit**--- users specify how much they liked a particular movie by providing a numerical rating.\n- **Implicit**--- if a user watches a movie, the system infers that the user is interested.\n\nTo simplify, we will assume that the feedback matrix is binary; that is, a value\nof 1 indicates interest in the movie.\n\nWhen a user visits the homepage, the system should recommend movies\nbased on both:\n\n- similarity to movies the user has liked in the past\n- movies that similar users liked\n\nFor the sake of illustration, let's hand-engineer some features for the movies\ndescribed in the following table:\n\n| Movie | [Rating](https://wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system#MPAA_film_ratings) | Description |\n|-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [The Dark Knight Rises](http://www.imdb.com/title/tt1345836) | PG-13 | Batman endeavors to save Gotham City from nuclear annihilation in this sequel to [The Dark Knight](http://www.imdb.com/title/tt0468569/), set in the DC Comics universe. |\n| [Harry Potter and the Sorcerer's Stone](http://www.imdb.com/title/tt0241527/) | PG | A orphaned boy discovers he is a wizard and enrolls in Hogwarts School of Witchcraft and Wizardry, where he wages his first battle against the evil Lord Voldemort. |\n| [Shrek](http://www.imdb.com/title/tt0126029/) | PG | A lovable ogre and his donkey sidekick set off on a mission to rescue Princess Fiona, who is emprisoned in her castle by a dragon. |\n| [The Triplets of Belleville](http://www.imdb.com/title/tt0286244) | PG-13 | When professional cycler Champion is kidnapped during the Tour de France, his grandmother and overweight dog journey overseas to rescue him, with the help of a trio of elderly jazz singers. |\n| [Memento](http://www.imdb.com/title/tt0209144/) | R | An amnesiac desperately seeks to solve his wife's murder by tattooing clues onto his body. |\n\n1D embedding\n------------\n\nSuppose we assign to each movie a scalar in \\\\(\\[-1, 1\\]\\\\) that describes\nwhether the movie is for children (negative values) or adults (positive values).\nSuppose we also assign a scalar to each user in \\\\(\\[-1, 1\\]\\\\) that describes\nthe user's interest in children's movies (closer to -1) or adult\nmovies (closer to +1). The product of the movie embedding and the user\nembedding should be higher (closer to 1) for movies that we expect the user\nto like.\n\nIn the diagram below, each checkmark identifies a movie that a particular\nuser watched. The third and fourth users have preferences that are\nwell explained by this feature---the third user prefers movies for children\nand the fourth user prefers movies for adults. However, the first and second\nusers' preferences are not well explained by this single feature.\n\n2D embedding\n------------\n\nOne feature was not enough to explain the preferences of all users. To overcome\nthis problem, let's add a second feature: the degree to which each movie is\na blockbuster or an arthouse movie. With a second feature, we can now represent\neach movie with the following two-dimensional embedding:\n\nWe again place our users in the same embedding space to best explain\nthe feedback matrix: for each (user, item) pair, we would like the\ndot product of the user embedding and the item embedding to be close\nto 1 when the user watched the movie, and to 0 otherwise.\n\n| **Note:** We represented both items and users in the same embedding space. This may seem surprising. After all, users and items are two different entities. However, you can think of the embedding space as an abstract representation common to both items and users, in which we can measure similarity or relevance using a similarity metric.\n\nIn this example, we hand-engineered the embeddings. In practice, the embeddings\ncan be learned *automatically*, which is the power of collaborative filtering\nmodels. In the next two sections, we will discuss different models to learn\nthese embeddings, and how to train them.\n\nThe collaborative nature of this approach is apparent when the model learns the\nembeddings. Suppose the embedding vectors for the movies are fixed. Then,\nthe model can learn an embedding vector for the users to best explain\ntheir preferences. Consequently, embeddings of users with similar preferences\nwill be close together. Similarly, if the embeddings for the users are fixed,\nthen we can learn movie embeddings to best explain the feedback matrix.\nAs a result, embeddings of movies liked by similar users will be close in\nthe embedding space.\n\nCheck your understanding\n------------------------\n\nThe model recommends a shopping app to a user because they recently installed a similar app. What kind of filtering is this an example of? \nContent-based filtering \nGood job! Content-based filtering doesn't look at other users. \nCollaborative filtering \nCollaborative filtering takes other users into consideration. In the given scenario we only care about one user."]]