HanseulJo / cuisine-prediction

0 stars 1 forks source link

[Expr] Graph based inferrence #17

Open StoryKami opened 2 years ago

StoryKami commented 2 years ago

그래프 기반 모델

인접 행렬 사용하여 그래프 기반으로 탐색 + 점수 누적

성능

completion task image recall과 map 수치가 거의 0. 모델 검증이 필요함. -->recall, map 계산에 오류 존재.

StoryKami commented 2 years ago

발견된 문제점

  1. 상위 n개 node 필터링 시, n개보다 적은 node만 score를 가질 경우, 나머지 node는 랜덤하게 골라짐. -> 해결
  2. MAP, recall@10 계산을 잘못 진행하고 있었음. -> 해결
StoryKami commented 2 years ago

수정 후 completion 모델

recall@10 거의 0.3까지 올라감. Acc는 0.015 수준. image

recall 성공 query에 대한 평균 Rank는 약 3. 나쁘지 않음. image

StoryKami commented 2 years ago

Classification model 실험 setting

edge weight를 recipe <-> ingred = w1, recipe <-> label = w2로 놓고, w1, w2를 [((1,1), (1,2), (1,4), (1,8), (2,1), (4,1), (8,1))]로 주고 실험 진행. depth는 20까지.

Classification model 실험 결과

Accuracy는 약 6%대로 그렇게 높지는 X. But, recall@5와 avg rank를 보면, 약 80%의 추천 결과가 상위 5개 내에서 정답을 가지고 있고, 이 중 평균 1.9위 즈음에서 정답이 나타남.

주목할만한 점

  1. 대부분 depth 2~5에서 가장 좋은 성능.
  2. ingred 가중치 / label 가중치 ratio가 높으면 초반 depth에서는 good, but 이후에 성능 하락이 심함.
  3. label의 가중치가 ingredient 대비 1/2일 때, depth가 깊어질수록 accuracy가 증가함. -> 초반에는 ingred 가중치를 높게 주고, 후반에는 낮게 주는 method?
  4. Depth 3~4에서 accuracy peak인데, recall@5는 감소 + avg rank도 감소. 양극화?

결론

보편적으로 좋아보이는 건 ingred weight/label weight = 0.5인 모델. 즉, label에 두 배정도 힘을 실어준 그래프가 괜찮아보임.

StoryKami commented 2 years ago

Completion model 재실험

위의 CLF task와 동일한 세팅. 결과는 다음과 같음.

결론

전체적으로 ingred weight : label weight = 1:2인 모델이 좋아보임

StoryKami commented 2 years ago

Completion Accuracy 코드 수정 후 재평가

Accuracy 계산 시, 상위 10개 item 중 무작위 하나를 골라 계산하던 문제가 있었음. 이를 수정하고 재평가 진행. 결과는 아래와 같음. image 대략 0.6~0.7 사이의 값.

StoryKami commented 2 years ago

앙상블용 모델 선정

Completion

1_2_depth6: 높은 recall@10 & 높은 recall_rank 1_4_depth4: 높은 acc * 높은 recall_rank 1_8_depth4: 최고 acc after depth 2 1_8_depth2: 최고 acc of all time

Classification

1_8_depth4: 최고 f1 after depth 2 1_8_depth2: 최고 f1 of all time