diff --git a/backend-recommend/recommend.py b/backend-recommend/recommend.py index 0460a72..6cd4c9a 100644 --- a/backend-recommend/recommend.py +++ b/backend-recommend/recommend.py @@ -54,7 +54,7 @@ def recByApriori(body): antecedents = set(row.antecedents) consequents = set(row.consequents) - if antecedents.issubset(input) and len(consequents) <= 2 and not antecedents.union(consequents).issubset(input): + if antecedents.isdisjoint(input) and len(consequents) <= 2 and antecedents.union(consequents).isdisjoint(input): key = tuple(consequents) if key not in matching_itemsets or confidence > matching_itemsets[key]: matching_itemsets[key] = confidence diff --git a/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java b/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java index 42da0ec..295dd07 100644 --- a/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java +++ b/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java @@ -5,6 +5,7 @@ import lombok.NoArgsConstructor; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Objects; @@ -31,6 +32,7 @@ public HistorySearchDto(int carId, int powerTrainId, int bodyTypeId, int operati public void addAllOption(List optionId) { optionIds.addAll(optionId); + Collections.sort(optionIds); } public String getOptionIds() { diff --git a/backend/src/main/java/autoever2/cartag/service/QuoteService.java b/backend/src/main/java/autoever2/cartag/service/QuoteService.java index 2596837..fa951a5 100644 --- a/backend/src/main/java/autoever2/cartag/service/QuoteService.java +++ b/backend/src/main/java/autoever2/cartag/service/QuoteService.java @@ -13,6 +13,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -26,6 +27,7 @@ public class QuoteService { public HistoryShortDto findMyQuote(QuoteDataDto quoteDataDto) { List optionIds = quoteDataDto.getOptionIdList(); + Collections.sort(optionIds); HistorySearchDto historyData = HistorySearchDto.builder() .carId(quoteDataDto.getCarId()) @@ -40,6 +42,7 @@ public HistoryShortDto findMyQuote(QuoteDataDto quoteDataDto) { public List findTopHistory(QuoteDataDto quoteDataDto) { List optionIds = quoteDataDto.getOptionIdList(); + Collections.sort(optionIds); if(optionIds.isEmpty()) { throw new InvalidDataException(ErrorCode.INVALID_PARAMETER);