Research Article

A Factor Marginal Effect Analysis Approach and Its Application in E-Commerce Search System

Algorithm 1

Process of feature importance.
(1)Input: dataset with features and labels, pretrain model
(2)Output: Shapley value for the value of the feature
(3)Required: number of iterations , instance of interest , feature index , data matrix , and machine learning model
(4)For all :
(5) Draw random instance from the data matrix
(6) Choose a random permutation of the feature values
(7) Order instance x:
(8) Order instance z:
(9) Construct two new instances,
(10)  With :
(11)   
(12)  Without :
(13)   
(14)  Compute marginal contribution:
(15)  Compute the Shapley value as the average:
(16)End For