Skip to content
JW
Product systemSupporting evidence2025

Intelligent E-commerce Recommendation

智能程序设计课程设计

A 55-page system report for an intelligent e-commerce recommendation application, covering recommendation logic and end-to-end software design.

Intelligent E-commerce Recommendation project diagram

55p

system report

04

behaviour types

Top-N

recommendation output

01 / Overview

What this package actually contains.

The intelligent e-commerce coursework implements a Spring Boot application with product browsing, user behaviour tracking, ratings and multiple recommendation strategies, including user-based collaborative filtering and fallback hot-product recommendations.

Objectives

  • 01Track views, favourites, cart activity and purchases as weighted behaviour signals.
  • 02Implement user-user collaborative filtering with a Pearson correlation similarity.
  • 03Provide product-based, personalised and fallback recommendations in a web application.

Product mechanics

User surface, mechanism, automation.

The system is explained through its modules and the behaviour they enable.

Module01

Spring Boot UI

Product, profile, rating and recommendation screens.

Module02

Behaviour events

View, favourite, cart and purchase signals with scores.

Module03

User-item matrix

Aggregated ratings and behaviour weights by user/product.

Module04

Similarity

Pearson correlation over users with common products.

Module05

Ranking

Weighted candidate scores, normalisation and Top-N output.

02 / Package highlights

What this work demonstrates.

  • Connects recommendation algorithms with application structure and user flows.
  • Shows a larger software-engineering deliverable beyond notebook analysis.
  • Includes the full report and source archive for technical review.

03 / Mechanism

How the product works end to end.

01

Behaviour becomes a rating

Explicit ratings and implicit actions are combined into a user-product score matrix. Each event type contributes a different weight, so a purchase can count more strongly than a view while still being normalised through the recommendation formula.

02

Collaborative filtering

For a target user, the service calculates Pearson correlation against every other user who shares at least two products. Positive similarities are retained, unseen products are scored by similarity × rating, and the final candidate score is divided by the sum of absolute similarities.

  • A minimum of two common products avoids unstable correlations.
  • Products already seen by the target user are excluded.
  • If collaborative filtering cannot produce enough candidates, hot-product recommendation is used as a fallback.
03

Application integration

The recommendation service is wired into Spring MVC controllers, MyBatis mappers, Thymeleaf templates and MySQL. This makes the project a complete application rather than an isolated algorithm notebook.

04 / Key code

Key product and contract logic.

Only verified source excerpts and pseudocode taken from the project papers are shown.

Verified project codeJava

Pearson similarity

Original Java excerpt from the recommendation service.

private double calculatePearsonCorrelation(
        Map<Integer, Double> ratingsA,
        Map<Integer, Double> ratingsB) {

    Set<Integer> commonItems = new HashSet<>(ratingsA.keySet());
    commonItems.retainAll(ratingsB.keySet());

    if (commonItems.size() < 2) return 0.0;

    double sumA = 0, sumB = 0;
    double sumASq = 0, sumBSq = 0, sumAB = 0;
    int n = commonItems.size();

    for (Integer itemId : commonItems) {
        double a = ratingsA.get(itemId);
        double b = ratingsB.get(itemId);
        sumA += a;
        sumB += b;
        sumASq += a * a;
        sumBSq += b * b;
        sumAB += a * b;
    }

    double numerator = sumAB - (sumA * sumB) / n;
    double denominator = Math.sqrt(
        (sumASq - sumA * sumA / n) *
        (sumBSq - sumB * sumB / n)
    );

    return denominator == 0 ? 0.0 : numerator / denominator;
}
Verified project codeJava

Weighted candidate scoring

Original Java excerpt showing normalisation and Top-N ranking.

for (var simEntry : userSimilarities.entrySet()) {
    double similarity = simEntry.getValue();
    var similarRatings =
        userProductMatrix.get(simEntry.getKey());

    for (var ratingEntry : similarRatings.entrySet()) {
        int productId = ratingEntry.getKey();
        double rating = ratingEntry.getValue();

        if (!targetUserRatings.containsKey(productId)) {
            scores.merge(
                productId, similarity * rating, Double::sum
            );
            simSums.merge(
                productId, Math.abs(similarity), Double::sum
            );
        }
    }
}

return scores.entrySet().stream()
    .filter(e -> simSums.get(e.getKey()) > 0)
    .collect(Collectors.toMap(
        Map.Entry::getKey,
        e -> e.getValue() / simSums.get(e.getKey())
    ))
    .entrySet().stream()
    .sorted(Map.Entry.<Integer, Double>comparingByValue().reversed())
    .limit(maxRecommendations)
    .collect(Collectors.toMap(
        Map.Entry::getKey,
        Map.Entry::getValue,
        (a, b) -> a,
        LinkedHashMap::new
    ));

Delivery notes

  • Recommendation logic is separated into a service layer and exposed through REST-like controller endpoints.
  • The matrix uses aggregated behaviour scores so implicit and explicit signals share one representation.
  • Fallback recommendations keep the page useful for new users with sparse histories.

Limitations / next steps

  • Pearson similarity is sensitive to sparse overlap and may not scale to millions of users.
  • A production system should add offline ranking evaluation, cold-start handling and model monitoring.

05 / Downloads

Files in this folder.

Open the original report, presentation or source archive. PDF cover pages with private details were removed.

PDF

System report

中文 · 55 pages · 14.7 MB

Sanitized 55-page report without the student cover page.

Open file
ZIP

Source archive

Mixed · 1.7 MB

Application source code and supporting files.

Download ZIP