Course recommendation method based on bipartite graph projection and node2vec

By constructing a student-course bipartite graph and utilizing the node2vec algorithm and logistic regression model, the features of students and courses are extracted, solving the problems of accuracy and personalization in course recommendation in online education and achieving efficient personalized course recommendation.

CN114254199BActive Publication Date: 2026-02-17HANGZHOU DIANZI UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111578447.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2026-02-17
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

Existing course recommendation methods struggle to accurately uncover students' potential interests when faced with individual differences among students and a vast amount of learning resources in online education, leading to a decline in recommendation effectiveness, especially when data sparsity increases.

Method used

We construct a student-course bipartite graph, extract student and course features using the node2vec algorithm, and combine it with a logistic regression model for link feature extraction and prediction to achieve personalized course recommendations.

Benefits of technology

This improves the accuracy of course recommendations, better meets the personalized learning needs of different students, and enhances learning efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114254199B_ABST
    Figure CN114254199B_ABST
Patent Text Reader

Abstract

The application provides a course recommendation method based on bipartite graph projection and node2vec. First, the application obtains online education student course selection data, encodes the data, describes the course selection information by using a bipartite graph, and divides a training set and a test set according to actual link conditions. A weighted projection matrix related to courses is obtained. Then, a node2vec algorithm model is called to generate optimal network node feature representations related to course and student nodes. A link feature vector is obtained through the feature vectors of the student nodes and the course nodes that have been obtained, and labels are set according to the known student-course bipartite graph links. Through a logistic regression model, training and prediction are performed, and a higher recommendation accuracy is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of recommendation, and relates to a course recommendation method based on a bipartite graph projection and node2vec. BACKGROUND

[0002] With the development of advanced scientific tools such as big data, artificial intelligence and intelligent hardware, as a product of the combination of information technology and education, online teaching has become a development trend of future education and has attracted more and more attention. Compared with traditional education, online education has the advantages of not being limited by time and space and strong continuity of knowledge learning. However, different students have different demands for learning resources due to individual differences, learning interest differences and training direction differences. Under the huge online education learning resources, the use of unified learning resources reduces the learning efficiency of students to a certain extent. Therefore, providing personalized course recommendation for students helps students to carry out efficient learning.

[0003] Course recommendation is a process of learning the characteristics of students and courses by using existing data information and making course recommendations for students. The core idea is to mine the learning preferences of students through the interaction information between students and courses. At present, the commonly used recommendation methods include a content-based recommendation method and a collaborative filtering-based recommendation method.

[0004] The content-based recommendation method relies on the characteristics of students to extract features, and recommends courses similar to the interest preferences of students according to the historical course selection of students. Specifically, first, student features are extracted, then the preference features of students are obtained according to the feature data of the courses selected or not selected by students, and finally a course recommendation list is generated for students according to the similarity calculation. This method depends on the selection of historical courses of students and cannot mine the potential interests of students. In addition, it is also difficult to accurately extract student features in this method.

[0005] The collaborative filtering-based recommendation method searches for the nearest neighbors of the target student, calculates the similarity between students through the rating matrix, and thus realizes the course recommendation for the target student. Common methods for calculating similarity include a cosine similarity-based method, an Euclidean distance-based method and a Pearson correlation coefficient-based method. This kind of method can accurately calculate the similarity under the condition that the feature attributes of data are relatively complete. However, with the sharp increase in the number of students and courses in online learning resources, the sparsity of data greatly increases, which makes the effect of this kind of recommendation method decline.

[0006] In real data, the lack of feature content and the sparsity of data are inevitable. The student and course are modeled as a bipartite graph, and the structured information is expanded based on the content information of the student and course. Secondly, the node2vec algorithm model is trained to better learn the features of students and courses, so as to make accurate course recommendations. SUMMARY

[0007] The present application is directed to the deficiencies of the prior art, and proposes a course recommendation method based on bipartite graph projection and node2vec.

[0008] The present application comprises the following steps:

[0009] Step 1: Construction of student-course bipartite graph

[0010] (1) Obtain the data set: extract the information of students and courses and the information of students' course selection from the online education student course selection data;

[0011] (2) Construct a bipartite graph: take the student information as a class of nodes, the course information as a class of nodes, and the course selection information as the link relationship, and construct a student-course bipartite graph B(V1, V2, E).

[0012] Step 2: Data set division

[0013] (1) Establish a student-course test bipartite graph: remove n% of the existing links in the student-course bipartite graph as positive-edges in the test sample, and the bipartite graph formed by the remaining links as the student-course test bipartite graph.

[0014] (2) Establish a student-course test sample: in all blank links of the student-course bipartite graph, extract the same number of blank links as the positive-edges removed to establish the test bipartite graph as negative-edges, and the positive-edges and negative-edges together constitute the test sample.

[0015] (3) Establish a student-course training bipartite graph: remove n% of the existing links in the student-course test bipartite graph as positive-edges in the test sample, and the bipartite graph formed by the remaining links as the student-course training bipartite graph.

[0016] (4) Establishing student-course training sample: In all blank links of the student-course test bipartite graph, extract the same number of blank links as the positive-edge removed for establishing the training bipartite graph as negative-edge, and the positive-edge and negative-edge together constitute the training sample.

[0017] Step 3: Student-course bipartite graph weighted projection

[0018] (1) Extracting student weighted projection graph: taking student V1 as node, extracting the common course relationship between student nodes in the student-course bipartite graph B'(V1, V2, E) to construct the student weighted projection graph G1(V1, E1, W1), and the weight W1 represents the number of common courses between student nodes.

[0019] (2) Extracting course weighted projection graph: taking course node V2 as node, extracting the relationship between course nodes in the student-course bipartite graph B'(V1, V2, E) to construct the course weighted projection graph G2(V2, E2, W2), and the weight W2 represents the number of students who choose two courses at the same time.

[0020] Step 4: Node feature representation of students and courses based on node2vec

[0021] (1) Node neighbor sequence acquisition based on second-order random walk:

[0022] a. Set the hyperparameter p to control the probability of repeatedly visiting the node just visited, and the hyperparameter q to control the direction of the walk;

[0023] b. Calculate the bias operator a of random walk passing through an edge (t, x) pq (t, x):

[0024]

[0025] where d tx is the shortest distance between nodes t and x;

[0026] c. Calculate the transition probability p of random walk passing through an edge (t, x) to reach node v vx = a pq (t, x) w vx , where w vx is the weight of edge (v, x);

[0027] d. Calculate the probability of visiting the next vertex x given the current node v:

[0028]

[0029] wherein Z is a normalization constant;

[0030] e. Generating random walk sequences according to the above probability.

[0031] (2) Learning vector representation of random walk sequences using skip-gram model:

[0032] a. One-hot encoding random walk sequences as input layer of the model;

[0033] b. Multiplying one-hot vectors with weight matrix to construct hidden layer;

[0034] c. Using SoftMax to construct output layer;

[0035] d. Training the model using stochastic gradient descent method.

[0036] (3) Obtaining student node vector representation f(V1) and course node vector representation f(V2): Generating random walk sequences and training skip-gram model on student weighted projection graph G1(V1, E1, W1) and course weighted projection graph G2(V2, E2, W2) respectively to learn student node vector representation f(V1) and course node vector representation f(V2).

[0037] Step 5: Student-Course Link Feature Extraction

[0038] (1) Calculating vector representation of student-course link: Based on vector representation of student node and course node, calculating vector representation of student-course link according to f(V1, V2) = f(V1)*f(V2);

[0039] (2) Setting label attribute of vector representation of student-course link: The label attribute of vector representation corresponding to the edge in student-course bipartite graph B'(V1, V2, E) is 1, otherwise 0.

[0040] Step 6: Binary classification model training and evaluation based on logistic regression

[0041] (1) Logistic regression binary classification model construction and training:

[0042] a. Constructing logistic regression model according to link features in student-course training samples and their corresponding label attributes.

[0043] b. Constructing loss function and obtaining minimum loss function by optimizing parameters. Finally, classification is performed by logistic regression.

[0044] (2) Student-Course Link Prediction Model Evaluation: The student-course training sample and student-course test sample established in step two are used as the training set and test set respectively. The training set is input into the logistic regression for model training. Then the test set is input into the trained model to obtain the labels of the test sample. Finally, the prediction accuracy is used to evaluate the prediction effect.

[0045] Advantages of the present application: The original student course selection data is first preprocessed by numbering. According to the different characteristics of students and course categories, a student-course bipartite graph is constructed. Based on the student and course content information, structured information is expanded. Then the projection matrix related to the course node and the student node is calculated. Through the node2vec algorithm, the best network node features can be extracted. According to the network node features, the student-course link features are extracted. Finally, the accuracy of the student course recommendation is evaluated by training the logistic regression model, and good results can be obtained. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 Flowchart of the present application

[0047] Figure 2 Construction of student-course weighted projection graph

[0048] Figure 3 Student and course feature node extraction graph based on node2vec algorithm

[0049] Figure 4 Student-course link feature extraction graph DETAILED DESCRIPTION

[0050] The present application will be further described below in conjunction with the accompanying drawings.

[0051] According to the flowchart shown in Figure 1 , and combined with actual data processing and model construction, each step of the method is introduced in detail.

[0052] Step 1: Construction of student-course data bipartite graph

[0053] (1) Obtain the data set: extract the student and course information and the student course selection information from the online education student course selection data;

[0054] (2) Construct a bipartite graph: take the student information as a class of nodes, the course information as a class of nodes, and the course selection information as a link relationship to construct a student-course bipartite graph B(V1, V2, E). The bipartite graph consists of 7118 student course selection information, 1001 student nodes and 613 course nodes.

[0055] Step 2: Data set division

[0056] (1) Construct a student-course test bipartite graph: Remove 10% of the existing links in the student-course bipartite graph as positive edges in the test samples, and use the remaining links to form the bipartite graph as the student-course test bipartite graph.

[0057] (2) Establish student-course test samples: In all the blank links of the student-course bipartite graph, extract the same number of blank links as the positive-edges removed to establish the test bipartite graph as negative-edges, and use the samples composed of positive-edges and negative-edges as test samples to test the model.

[0058] (3) Construct a student-course training bipartite graph: Remove 10% of the existing links in the student-course test bipartite graph as positive edges in the test samples, and use the remaining links to form the bipartite graph as the student-course training bipartite graph.

[0059] (4) Establish student-course training samples: In all the empty links of the student-course test bipartite graph, extract the same number of empty links as the positive-edges removed to establish the training bipartite graph as negative-edges, and use the samples composed of positive-edges and negative-edges as training samples for subsequent supervised learning to train the model.

[0060] Step 3: Weighted projection of the student-course bipartite graph

[0061] (1) Extract the student weighted projection diagram: such as Figure 2 As shown, taking student V1 as a node, the common course selection relationship between student nodes is extracted in the student-course bipartite graph B'(V1,V2,E), and a student weighted projection graph G1(V1,E1,W1) is constructed, where the weight W1 represents the number of common courses selected between student nodes.

[0062] (2) Extract the course weighted projection diagram: such as Figure 2 As shown, taking course node V2 as a node, the relationship between course nodes is extracted in the student-course bipartite graph B'(V1,V2,E), and a course weighted projection graph G2(V2,E2,W2) is constructed, where the weight W2 represents the number of students who select two courses at the same time.

[0063] Step 4: Feature extraction of courses and students based on node2vec

[0064] (1) Obtaining the nearest neighbor sequence of nodes based on second-order random walk:

[0065] a. Set the hyperparameter p to control the probability of revisiting a previously visited node, and the hyperparameter q to control the direction of the walk. In this embodiment, p is set to 0.5 and q to 2.0.

[0066] b. Calculate the skewness operator α of a random walk traversing an edge (t, x). pq (t,x):

[0067]

[0068] Where d tx Let x be the shortest distance between nodes t and x;

[0069] c. Calculate the transition probability π of a random walk reaching node v via an edge (t,x). vx =α pq (t,x)·w vx , where w vx Let x be the weight of the edge (v,x);

[0070] d. Calculate the probability of visiting the next vertex x given the current node v:

[0071]

[0072] Where Z is the normalization constant;

[0073] e. Generate a random walk sequence based on the probabilities described above.

[0074] (2) Obtaining the nearest neighbor sequence of nodes based on second-order random walk:

[0075] a. One-hot encoding is applied to the random walk sequence as the input layer of the model;

[0076] b. Construct hidden layers by multiplying one-hot vectors by weight matrices;

[0077] c. Use SoftMax to construct the output layer;

[0078] d. The model is trained using stochastic gradient descent.

[0079] (3) Obtaining the student node vector representation f(V1) and the course node vector representation f(V2): For example... Figure 3As shown, random walk sequences are generated and skip-gram models are trained on the student-weighted projection map G1(V1,E1,W1) and the course-weighted projection map G2(V2,E2,W2), respectively. The feature vector dimension of the training model is set to 32; the window size is 5; the number of parallel workers for training is 2; and the number of iterations is set to 3. The student node vector representation f(V1) and the course node vector representation f(V2) are learned. Through this step, a total of 1001 32-dimensional student feature vectors and 613 32-dimensional course feature vectors are obtained.

[0080] Step 5: Student-Course Link Feature Extraction

[0081] (1) Calculate the vector representation of student-course links: Based on the vector representations of student nodes and course nodes, obtain the vector representation of student-course links according to f(V1,V2)=f(V1)*f(V2);

[0082] (2) Set the label attribute of the vector representation of the student-course link: the label attribute of the vector representation of the edge in the student-course bipartite graph B'(V1,V2,E) is 1, otherwise it is 0.

[0083] Step 6: Training and Evaluation of the Logistic Regression-Based Divider Model

[0084] (1) Logistic Regression Training Process:

[0085] a. such as Figure 4 As shown, a logistic regression model is constructed based on the link features in the student-course training samples and their corresponding label attributes.

[0086] b. Construct a loss function, select the quasi-Newton method as the optimization method, and iteratively optimize the loss function by using the second derivative matrix of the loss function, i.e., the Hessian matrix. Finally, perform classification using logistic regression.

[0087] (2) Evaluation of the Student-Course Link Prediction Model: In this embodiment, 640 positive-edges and 640 negative-edges were selected as the student-course training set samples to train the logistic regression model. The student-course test samples were used as the test set, input into the trained model, and the prediction accuracy was calculated, where y test The label values ​​of the test set, y pre The predicted values ​​are obtained after training with logistic regression. The prediction accuracy of methods such as random forest, SVM, and preferential attachment on student-course data is also compared.

[0088]

[0089] Table 1. Course recommendation accuracy under different methods

[0090]

[0091]

Claims

1. A course recommendation method based on bipartite graph projection and node2vec, characterized in that... include: Step 1: Construct the student-course bipartite graph; Step 2: Dataset Partitioning Step 3: Weighted projection of the student-course bipartite graph; Step 4: Node feature representation of students and courses based on node2vec; Step 5: Extract student-course link features; Step 6: Training and evaluation of the logistic regression-based binary divider model; Step 1 includes: 1-1. Extract relevant information about students, courses, and student course selections from online education student course selection data; 1-2. Construct a student-course bipartite graph by treating student information as one type of node, course information as another type of node, and course selection information as the link relationship. Step 2 includes: 2-1. Construct a student-course test bipartite graph; 2-2. Establish student-course test samples; 2-3. Construct a student-course training bipartite graph; 2-4. Establish student-course training samples; Step 3 includes: 3-1. Extract the common course selection relationships from student nodes and construct a weighted projection graph of students, with the weight being the number of common course selections; 3-2. Extract the common course selection relationships in the course nodes, construct a course weighted projection graph, and select the number of students who take two courses at the same time as the weight; Step 4 includes: 4-1. Obtain the node adjacency sequence based on second-order random walk; 4-2. The skip-gram model is used to learn the vector representation of the random walk sequence; 4-3. Obtain the vector representation of course nodes and the vector representation of student nodes; Step 5 specifically includes: 5-1. Calculate the vector representation of the student-course link; 5-2. Set the label attribute for the vector representation of the student-course link. The label attribute for the vector representation of the edge in the student-course bipartite graph should be 1, otherwise it should be 0. Step 6 specifically includes: 6-1. Construction and training of a logistic regression binary classification model; 6-2. Input the training set into the logistic regression model for training. After training, evaluate the results of the test set using acc.

2. The course recommendation method based on bipartite graph projection and node2vec according to claim 1, characterized in that: The specific steps for establishing the student-course test bipartite graph are as follows: remove n% of the existing links from the student-course bipartite graph to serve as positive edges in the test samples, and use the remaining links to form the bipartite graph as the student-course test bipartite graph.

3. The course recommendation method based on bipartite graph projection and node2vec according to claim 2, characterized in that: The specific steps for establishing the student-course test sample are as follows: In all the blank links of the student-course bipartite graph, extract the same number of blank links as the positive-edges removed to establish the test bipartite graph and use them as negative-edges. The sample composed of the positive-edges and negative-edges is then used as the test sample.

4. The course recommendation method based on bipartite graph projection and node2vec according to claim 1, characterized in that: The specific steps for establishing the student-course training bipartite graph are as follows: remove n% of the existing links from the student-course test bipartite graph and use them as positive edges in the test samples, and use the remaining links to form the bipartite graph as the student-course training bipartite graph.

5. The course recommendation method based on bipartite graph projection and node2vec according to claim 4, characterized in that: The specific steps for establishing student-course training samples are as follows: In all the blank links of the student-course test bipartite graph, extract the same number of blank links as the positive-edges removed to establish the training bipartite graph, and use the samples composed of the positive-edges and negative-edges as training samples.

6. The course recommendation method based on bipartite graph projection and node2vec according to claim 1, characterized in that: Step 6-1 specifically involves: a. Construct a logistic regression model based on the link features and corresponding label attributes in the student-course training samples; b. Construct a loss function, optimize the parameters to obtain the minimum loss function, and finally perform classification using logistic regression.

Citation Information

Patent Citations

  • Online course recommendation method

    CN113722591A

  • Web-Based Education System

    US20130311409A1