Research Article

Deep Forest-Based E-Commerce Recommendation Attack Detection Model

Algorithm 1

Centroid symmetric sampling algorithm.
(1)Extract majority class data from the dataset.
(2)Apply the k-means algorithm to cluster the majority class data.
(3)Output: Set of cluster divisions.
(4)Data within each cluster.
(5)Number of clusters, k.
(6)for i = 1, 2, 3, …, k do
(7)Compute the distance from each sample in the cluster to the centroid using Algorithm 1.
Where represents a sample point in the cluster, represents the cluster centroid.
(8)Sort the samples within the cluster in descending order based on their distances.
 for j = 1, 2, 3, …, do
  If
Sigma represents the mean of the sample distances, represents the total number of samples sampled within each cluster.
(9)Identify and remove outliers.
(10)Select the first sample based on Algorithm 1.
Represents the i-th farthest distance midpoint.
 if exit
(11)  end for
(12) end for