Evolving Case-Based Reasoning with Genetic Algorithm in Wholesaler’s Returning Book Forecasting Pei-Chann Chang, Yen-Wen Wang, Ching-Jung Ting, Chien-Yuan Lai, and Chen-Hao Liu Department of Industrial Engineering and Management, Yuan-Ze University, Nei-Li, Tao Yuan, Taiwan, R.O.C., 32026
[email protected]
Abstract. In this paper, a hybrid system is developed by evolving Case-Based Reasoning (CBR) with Genetic Algorithm (GA) for reverse sales forecasting of returning books. CBR systems have been successfully applied in several domains of artificial intelligence. However, in conventional CBR method each factor has the same weight which means each one has the same influence on the output data that does not reflect the practical situation. In order to enhance the efficiency and capability of forecasting in CBR systems, we applied the GAs method to adjust the weights of factors in CBR systems, GA/CBR for short. The case base of this research is acquired from a book wholesaler in Taiwan, and it is applied by GA/CBR to forecast returning books. The result of the prediction of GA/CBR was compared with other traditional methods.
1 Introduction Wholesales in Taiwan are under the extremely competitive environment, in order to face the complex market competitions; they are trying their best to make the ultimate policy. The completeness of the information available to the decision maker is the key influencing the quality of the decisions. A book wholesaler could have better controls if sales forecast is conducted for a new book, and simultaneously another forecast for book returning is evaluated after the release. In business forecasting, managers often apply the outcomes of past similar cases to predict the result of the current one. Traditionally, the methods to be applied in sales forecasting include naive prediction, statistical methods, or artificial intelligent methods. Among these methods, artificial intelligent (AI) methods are mostly used in academic studies because of the ability to provide rapid solutions with high accuracy and to deal with diversified cases. Among AI methods, Case based reasoning (CBR) has been paid attention gradually. The earliest contributions to the area of CBR were from Schank and his colleagues at Yale University [19, 20]. During 1977-1993, CBR research was highly considered as a conceivable high-level model for cognitive processing. [1] indicated that CBR systems have been successfully used in several domains such as diagnosis, prediction, control, and planning. Based on the survey conducted by [23, 24], there were more than 130 enterprises using CBR systems to solve many kinds of problems in companies at the end of 1997. L. Wang, K. Chen, and Y.S. Ong (Eds.): ICNC 2005, LNCS 3612, pp. 205 – 214, 2005. © Springer-Verlag Berlin Heidelberg 2005
206
P.-C. Chang et al.
For the book industry in Taiwan, it is very difficult to predict sales and returned volumes because the products have various classifications and different lengths of life-cycles, and the environment in this industry is very unique. Average, there are about 3412.6 new books being published every month in Taiwan, and the speed for new released books is really high. The returning rate of books is more than 30% in this industry according to the actual data collected from the wholesaler and from past studies (Council for Culture Affairs [9]). The main reason of high book returning rate is caused by the insufficient information of book sales status in the book supply chain which brings up bullwhip effect and form up the unbalanced situation between supply and demand. Blind returning activities are happening so often because retailing bookstores are often space limited, without efficient computerized managing system, and moreover they do not have to bear any forward and reverse logistics cost. High book returning rate is a very heavy burden for all companies in this industry. Hence, we propose a returning forecasting system for slow-selling books for wholesaler to advise its retailers on returning book decision making to avoid blind returning movements. The system is a hybrid CBR method integrating a conventional CBR with adjusted factor weights by Genetic Algorithms (GAs) method to conduct a high accurate and efficient book returning forecast to reduce high book returning rate to increase profits. The remainder of this paper is organized as follows: Section 2 describes relevant literature review. Section 3 presents the hybrid method that integrates CBR with GAs based. Section 4 shows problem description. Section 5 depicts experimental design and results. In the final section, the conclusion is presented.
2 Literature Review In the book industry, returning books forecast is equally important to sales forecast. Under the environment of limited space, low computerized level, frequent release of new books and no forward/reverse logistics cost for retailers, books are returned to wholesales so often without proper evaluations. Retailers might return selling books and place the order again later. This could affect the profit of wholesales, competitive ability of retailers, and also may lead the publishers to re-print a book without proper market demands. Therefore, it should be very important for Taiwan book industry to value the issue of return book forecast, and provide a proper and accurate list of possible slow-selling books to the retailers for correct book returning activities, and also for publishers to evaluate and may introduce promotion strategy for the slowselling books. In the early years, studies regarding forecasting mainly relied on statistical techniques such as exponential smoothing, regression model, autoregressive and moving average (ARMA), etc. ([3] [7] [10] [11] and [18]). As time goes by, the internal and external environments for enterprises are becoming more and more complex. Traditional statistical prediction methods are no longer effective enough to deal with the problems. Therefore, Artificial Intelligence algorithms were applied to face the changes as in [21] and [25]. The algorithms such as Artificial Neural Network
Evolving Case-Based Reasoning with Genetic Algorithm
207
(ANNs), Fuzzy method, CBR, Genetic Algorithm (GA) and data envelopment analysis, etc., have been widely applied to many fields such as bankruptcy prediction ([8] and [12]), Stock market prediction ([2], [13], [16] and [22]) and all kinds of sales prediction ([4], [5] and [6]). There were so many researchers that have been comparing different prediction methods ([14] and [15, 17]). From the literatures reviewed, the study focusing on returning books forecast is rarely discussed. Therefore, this study would like to focus on the book markets and develop an accurate and practical returning books forecasting model.
3 Methodology GAs and CBR were used in this research to build up an alarm list of slow-selling books and assisting system for returned book handling. The advantages of conveying implicit knowledge, comparing characteristics provided by CBR, and the function of random search by GAs providing different weights of factors could increase the accuracy of forecast. Four models were established in this research: Model A – Hybrid System of GAs and CBR, Model B – Conventional back propagation neural network(BPN), Model C - Conventional CBR and Model D - Multiple-regression analysis. These four models were selected into this research for analysis and comparison. 3.1 Genetic Algorithms CBR emphasizes on how to describe and retrieve cases, and one of the crucial points is the combination of the weight and each characteristic factor. In this section, we will describe the process of using GAs to find the optimal weight for each factor in CBR ). The steps of finding the best combination are described as below: Step 1. Encoding The most common encoding method for gene is binary number used as the original calculating system by computer. It is very convenient to operate the encoding, crossover and mutation steps of GAs. Each factor influencing book returning is given a weight with the combination of eight binary numbers. Step 2. Generate the Initial Population Initial weights are randomly generated between 0 and 1; these initial solutions form the first population. The weights in the chromosomes will be evaluated by GAs operator later. Step 3. Compute the objective function The purpose of finding the objective function is to keep good chromosomes. The objective function of each chromosome will be compared to the best fitness function currently, and if the new chromosome is better the current fitness function, then the new one will be kept to produce next generation. The objective function of this research is to find out the most accuracy for slow-selling books forecast. Description of objected function listed and accuracy as Table 1 and Table 2 below.
208
P.-C. Chang et al. Table 1. Description of Notations
Notation M(T) Oi
description Objective function of forecasting slow-selling books for set of T training cases Comparison of predicted result to actual result for case i. If the same Oi = 1; different Oi = 0
Pi
Predicted result of case i in training cases
Ai
Actual result of case i in training cases
R
Set of reference cases, R = {r1 , r2 , L , rn } .
T
Set of training cases, T = {t1 , t 2 , L , t k } .
Y(rj) Sij D
The result of case j of reference cases that is the most similar to case i of training cases. Similarity degree between case i of training cases and case j of reference cases Sum of distances between each weighted factors of training cases and reference cases.
f jh
Value of factor h of case j in reference cases.
f ih
Value of factor h of case i in training cases.
wh
Weight of factor h in reference cases. Table 2. Decision Variables and Objective Function for Book Returning Problems
Training cases
Pi
Ai
Oi
Book1
slow-selling
selling
0
Book2 : : Booky
slow-selling : : slow-selling
slow-selling : : slow-selling
1 : : 1
Total M(T)
∑ Oi
k
i =1
1. Objective function: k
Max M(T) = ∑ Oi
(1)
i =1
s.t. Oi = 1 , if Pi = Ai Oi = 0 , if Pi
≠
Ai
Evolving Case-Based Reasoning with Genetic Algorithm
209
2. Calculation of Pi
Let Set of reference cases R = {r1 , r2 , L , rn } , j=1,2,...,n Set of training cases T = {t1 , t 2 , L , t k } , i=1,2,…,k Pi = Y (r j )
(2)
[ ( )] and
if Sij = Min D r j , ti j
(
)
D r j , ti =
m
∑ wh( f jh − f ih ) 2
, h=1,2,…,m ,where m is the total number of factors
h =1
Step 4. Compute the fitness function The original concept of fitness is “the larger the better”, because solutions with larger fitness tend to propagate to the next generation. The objective function for the problem of slow-selling books forecast described in this research is to find the accuracy value which is also “the larger the better.” Therefore the objective function is fitness function for a set of training cases. k
fit (T)=M(T)= ∑ Oi i =1
(3)
Step 5. Reproduction / Selection The roulette wheel selection method is applied in this research and the value of the fitness function represents the area proportion of each string on the roulette wheel, also represents the probability of being selected. Therefore, a chromosome with larger fitness function value means it has greater probability of being selected for crossover. The probability p(x ) of each chromosome x will be chosen to re-produce as defined below:
p(x ) =
fit(x) ∑ fit(x)
(4)
Step 6. Crossover After the parameter design, two-point crossover method is applied in the research. Step 7. Mutation After the parameter design, one-point mutation method is applied in the research. Step 8. Elite Strategy Elite strategy is applied in this research in order to have greater probability for good chromosomes to propagate excellent next generation. 30% of parent chromosomes and 70% offspring chromosomes are used in this research. Step 9. Replacement The new population generated by the previous steps updates the old population. Step 10. Stopping criteria If the number of generations equals to the maximum generation number then stop, otherwise go to step 3.
210
P.-C. Chang et al.
3.2 A Hybrid System Combining GAs and CBR
The operation process for the integration is listed as below: Step 1. Inputs of new case New case needed to be solved is the input in the CBR system in order to find out the solutions of related problem from the past case-base. Step 2. Factor analysis of new case Each new case is composed of many related characteristics, and the factor representing each case would be determined in this state. It is very important to select the related factors since the completeness of a case could influence the computing outcome. Five basic factors including grade of author, grade of publisher, hot or slow season of the publishing date, sales volume for first three months, and returning rate. Step 3. Calculated Weight of Factors Using GAs approach to find the optimal weight for each factor. Step 4. Find out the most matching case from reference cases for the new case using similarity rule. This stage would find out the most matching case from reference cases using similarity rule in order to predict the possible slow-selling book for the new case.
[(
S ij = Min D r j , t i j
(
)]
) ∑ wh( f jh − f ih ) 2 h =1
(5)
m
D r j , ti =
(6)
Step 5. Case Adaptation After the steps above, the most matching case from reference cases was selected and it would have the most similarity to the new case. K-Nearest Neighbors was added to gain more matching cases from reference cases. k numbers of best matching cases from reference cases were produced by K-Nearest Neighbors. We set k = 5 in this research, and determine the new case result to be the same as most results of 5 best matching case from reference cases. For example, the new case would be slow-selling book if the 5 most matching case from reference cases are mostly slow-selling books. Step 6. Verifying the results The forecasted values in this research are either 0 or 1 (True/False Question), and mean error method is applied as the measurement benchmark to verify the forecasted results of training cases and testing cases. Mean error rate =
1 n ei ∑ n i=1 yi
Where,
ei is the forecast error for experiment i yi is the total number of forecasted cases in experiment i n is the total number of experiments
(7)
Evolving Case-Based Reasoning with Genetic Algorithm
211
Mean Error values are the forecasting benchmarks to evaluate the accuracy of these four proposed models in this research.
4 Experiment Results and Analysis In this research, the data were collected from a book wholesaler company in Taiwan. This company is one of the leading book wholesalers in Taiwan, and its distribution channels are widely spread out all around Taiwan. Books to be distributed by this company are covering almost all categories in the market. Therefore, data collected in this research are quite representative for this industry. Data collected for this research started from May 01, 2002 to April 30, 2003, and total of 904 cases including selling books and slow-selling books. 904 cases were randomly divided into reference cases, training cases, test cases and reserved cases listed as Table 3 below. Reference cases and test cases were used in the GA/CBR returning books forecast system described in this research to find out the best weight for each factor. Test cases were then used to verify the accuracy of this forecast system. Reserved cases would be added into test cases later in order to see if the accuracy of this system would be affected by the numbers of test cases. Data collecting time for each case would be nine months including actual sales volume for the first three months to be used as a factor in the forecast system, and the actual total sales volume for the six months coming afterward would be used as the base to define a book as a slow-selling book when total sales volume is less then 5 books. Therefore, total collecting time for actual sales volumes for these 904 cases started from May 01, 2002 until Jan. 31, 2004. Table 3. Groups for collected cases
Group
Reference Cases
Volume
404
Selling vs. Slowselling Books
259:145
Training Cases
Test Cases
Reserved Cases
200
100
200
102:98
56:44
96:104
Major software used in this research including VISUAL BASIC 6.0, Microsoft Access 2002 (Model A, C), Minitab 13, Neural Works Professional II V5.20 (Model B) and Microsoft Excel 2002 (Model D). Try and error method is used to find out the best epoch size, and the system becoming stabilized when epoch size exceeds 150,000 times with mean error value of 0.08. We set the epoch size as 180,000 in order to make sure each experiment could reach convergence. Forecast results for each model under the combination of 404 reference cases, 200 training cases and 100 testing cases are shown as Table 4. Besides, reserved cases are added into reference cases for calculation gradually, and the forecast results are being compared to training cases and testing cases for each model shown as Table 5 and 6.
212
P.-C. Chang et al. Table 4. Analysis of forecast errors for each model under 404/200/100 combination Reference Mo
Selling Model A Slowselling Selling Model B Slowselling Selling Model C Slowselling Selling Model D Slowselling
Training cases Testing case Error Total Mean error Error Total Mean Error numbers number rate numbers number rate 2 102 0.020* 1 56 0.018* 12
98
0.122*
6
44
0.136
3
102
0.029
4
56
0.071
13
98
0.133
4
44
0.091*
8
102
0.078
5
56
0.089
18
98
0.184
7
44
0.159
16
102
0.157
8
56
0.143
14
98
0.143
5
44
0.114
Table 5. Mean error value of training cases under different reference cases numbers for Model A, B, C and D Reference
204
304
404
504
604
Model A
0.1*
0.085*
0.07*
0.022*
0.022*
Model B
0.113
0.085*
0.08
0.067
0.06
Model C
0.155
0.14
0.13
0.065
0.06
Model D
0.15
0.15
0.15
0.15
0.15
Mo
*The least mean error value under different reference cases numbers Table 6. Mean error value of testing cases under different reference cases numbers for Model A, B, C and D Reference
204
304
404
504
604
Model A
0.07*
0.073*
0.07*
0.043*
0.04*
Model B
0.097
0.083
0.077
0.050
0.046
Model C
0.14
0.11
0.12
0.11
0.1
Model D
0.13
0.13
0.13
0.13
0.13
Mo
*The least mean error value under different reference cases numbers
Evolving Case-Based Reasoning with Genetic Algorithm
213
Summary and comparison of forecast results: 1. The result of experiment indicates Model A (GA/CBR) has better forecasting ability on selling books than other models, but slightly higher forecast error rates than Model B on slow-selling books. Practically, higher forecast accuracy of selling books could help wholesalers to reduce loss of opportunity costs by misjudge the selling books into slow-selling books. 2. The order of best to worst forecasting ability is Model A, Model B, Model C and Model D. Model A has better performance and higher forecast accuracy then other models under each training cases and each testing cases. 3. Factor weights are both being adjusted under Model A and Model B. Weights being adjusted by Fitness Function under GA in Model A and by bias under Model B. Model A has better forecasting performance under training cases and testing cases than Model B because GA calculates factor weights by global search. 4. Model A with adjusted factor weights under GA presents better forecasting ability than Model C with same factor weights under conventional CBR indicating adjusted factor weights could have better forecasting accuracy and represent the real world.
5 Conclusion This research discusses how to integrate the GAs and CBR approaches to construct a hybrid system of returning books forecasting. It can help book wholesalers determine the advising list of returning books for the retailers and also the warning list of slowselling books for publishers. There are so many new books being released each year in Taiwan, and create so many book returning problems. The advising list of returning books could help the space-limited book retailers to make best returning decision and also let the publishers have time to deal with the slow-selling books to make a winwin solution for all parties in the supply chain.
References 1. Aamodt, A. and Plaza, E.: Case-based reasoning: foundational issues, methodological variations, and system approaches. Artificial Intelligence Communication, 7(1) (1994) 39-59. 2. Baba, N. and Kozaki, M.: An Intelligent forecasting system of stock price using neural networks. Proceedings of the International Joint Conference on Neural Networks, 1 (1992) 371-377. 3. Chambers, J.C., Mullick, S.K. and Smith, D.D.: How to choose the right forecasting technique. Harvard Business Review, 49 (1971) 45-79. 4. Chang, P.C. and Lai, C.Y.: A Hybrid System Combining Self-Organizing Maps with Case-Based Reasoning in Wholesaler’s New-release Book Forecasting. Expert Systems with Applications, 29(1) (2005)183-192. 5. Chang, P.C. and Lai, K.R.: Combining SOM and Fuzzy Rule Base for Sale Forecasting in Printed Circuit Board Industry. J. Wang, X. Liao, and Z. Yi (Eds.): ISNN, LNCS 3498 (2005) 947-954.
214
P.-C. Chang et al.
6. Chang, P.C., Wang, Y.W. and Tsai, C.Y.: Evolving Neural Network for Printed Circuit Board Sales. Expert Systems with Applications, 29(1) (2005) 83-92. 7. Chase, C.W.: Ways to improve sales forecasts. Journal of Business Forecasting. 12(3) (1993) 15-17. 8. Cielen, A., Peeters, L. and Vanhoof, K.: Bankruptcy prediction using a data envelopment analysis. European Journal of Operational Research, 154 (2004) 526-532. 9. Council for Culture Affairs: The research for Book published market in R.O.C., Council for Culture Affairs of the Executive Yuan of the Republic of China, Taiwan (2000). 10. Fliedner, E.B. and Lawrence, B.: Forecasting system parent group formation: An empirical application of cluster analysis. Journal of Operations Management. 12 (1995) 119-130. 11. Florance, M.M. and Sawicz, M.S.: Positioning sales forecasting for better results. Journal of Business Forecasting. 12(4) (1993) 27-28. 12. Jo, H. and Han, I.: Integration of Case-based forecasting, Neural network, and Discriminant analysis for bankruptcy prediction. Expert System with Application. 11(4) (1996) 415-422. 13. Krolzig, H.M and J. Toro: Multiperiod forecasting in stock markets: a paradox solved. Decision Support Systems, 37 (2004) 531-542. 14. Kuo, R.J. and Xue, K.C.: A Decision Support System for sales forecasting through fuzzy neural networks with asymmetric fuzzy weights., Decision Support Systems, 24 (1998) 105-126. 15. Kuo, R.J., Wu, P. and Wang, C.P.: An intelligent sales forecasting system through integration of artificial neural networks and fuzzy neural networks with fuzzy weight elimination. Neural Networks, 15 (2002) 909-925. 16. Leigh, W., Purvis, R. and Ragusa, J.M.: Forecasting the NYSE composite index with technical analysis, Pattern Recognizer, Neural Network, and Genetic Algorithm: A case study in romantic decision support. Decision Support Systems, 32(2002) 361-377. 17. Mair, C., Kadoda, G., Lefley, M., Phalp, K., Schofield, C., Shepperd, M. and Webster, S.: An investigation of machine learning based prediction systems. The Journal of Systems and Software, 53 (2000) 23-29. 18. Rice, G. and Mahmoud, E.: Political Risk\Forecasting by Canadian. International Journal of Business Forecasting, 6 (1990) 89-120. 19. Schank, R. and Abelson, R. (eds.): Scripts, Plans, Goals and Understanding, Lawrence Erlbaum Associates, Hillsdale, NJ (1977). 20. Schank, R.: Dynamic Memory: A Theory of Reminding and Learning in Computers and People. Cambridge University Press, New York (1982). 21. Tan, K.C., Lim, M.H., Yao, X., and Wang, L.P. (Eds.): Recent Advances in Simulated Evolution and Learning. World Scientific, Singapore (2004). 22. Wang, X., Phua, P. K. H. and Lin, W.: Stock market prediction using neural networks: does trading volume help in short-term prediction?. Proceedings of the International Joint Conference. 4 (2003) 2438-2442. 23. Watson, I.: Applying Case-Based Reasoning: Techniques for Enterprise Systems. Morgan Kaufmann Publisher Inc., San Francisco (1997). 24. Watson, I. and Marir, F.: Case-based reasoning: A review. Knowledge Engineering Review. 9(4) (1994). 25. Yao, X.:Evolutionary Computation: Theory and Applications. World Scientific, Singapore (1999).