trend among all the impacts from the transactions is a slightly downward trend of about 20%.
Regardless the overall goal of the project was achieved. Contributing with integrating a categorization service and an UI where a user can see an approximation of the socio- ecological impacts of their transactions in addition to filtering the transactions to distin- guish the impacts of individual transactions.
6.4
Future Work
Multi-level Approach
An alternative to the current approach would however be to split up the categorization into more steps, like described as one approach in [8]. Specifically one could split it up into the two levels we have already defined for the MCC taxonomy. Given the prior assumptions we would then get the time and memory complexity in Eq. 6.3 for level 1 and 6.5 for level 2 when training models. Further Eq. 6.4 when predicting. As with multiple binary models used each one of them need to be when doing predictions. Predictions would thus go faster, while it would allow the system to utilize hardware that is bottle-necked by memory as one could simply train less models at a time.
O(cn) (6.3) O(K c n c) =⇒ O( Kn c ) (6.4) O(cKn c ) =⇒ O(Kn) (6.5) Splitting up the model into two layers might also help in the cases where model is insecure about the second level, or even about the first level. As then the user can still get the level 1 categories the model think are rated most likely and start from there. Rather than having to go through all of the possible close to 300 categories.
It is also possible that there is some kind of similarity between codes grouped under a level 1 category, thus perhaps compensating slightly for categories that just don’t exist in the data. Thus causing the model to misinterpret it as another category. Luckily there are also no level 1 categories missing completely and only one with less than 1000 at 824.
As described in [8] we could instead introduce more labels, where we would in this case simply double the data used, using the level 2 categories for the new half.
Named Entity Recognition
As many transactions and even some MCC codes contain named entities it would be likely be a good approach to do named entity recognition (NER). Where POS-tagging could also be used to both add more information and aid with pointing out what words actually are named entities. There would secondly also need to be some kind of database to compare and actually recognize these named entities. Here a wide variety of sources could be used, WikiData [https://www.wikidata.org] is one strong contender.
6. Conclusions
Database integration
Given that the system does come into use, integrating the users transactions through the database would be a natural step to getting more data. Where the thought is for the users to actively participate in categorizing data. Or rather verifying that transactions are labeled correctly through active learning [18]. The correctly labeled transactions can then later be looped back and be used for training the model and potentially filling the missing category gaps.
More Advanced Analytics
Due to the sheer volume of labels there was no confusion matrix made. A next step could be to find ways to more easily visualise very large confusion matrices. Splitting the training into several smaller models would however also make the confusion matrices much smaller and thus alleviate much of these issues. Using a confusion matrix would in turn enable activities like deciphering why a few of the categories performed badly. Where one could then observe what labels the model was labeling the transactions instead, from which a new feature could possibly be used do disambiguate the overlapping categories.
Other analytics that needs to improve in the future are how the impact computation results compare to the actual results, where one would ideally like to see how the impact computation vary depending on what category the transaction is and not just for a total set of transactions. This can then be combined with the confusion matrix to actually see how each category is likely to swing rather than have to use an actual test set. Thus further reducing the bias of the test set, where the amounts could be completely disconnected from the comparison.
Usability Testing
Usability testing on users are planned for the future to actually determine the usability this subset of the system has and thus determine to what degree this projects contributions could actually help a user with analysing their financial transactions.
Bibliography
[1] Apache Spark. Mllib evaluation metrics, January 2016. https://spark.apache.org/docs/latest/mllib-evaluation-metrics.html.
[2] British authorities. Description about the latest version of the taxonomy proclass, January 2016. http://proclass.org.uk/latest-version.html.
[3] British authorities. Official "frequently answered questions" for the taxonomy pro- class, January 2016. http://proclass.org.uk/faqs.html.
[4] British authorities. Official guidelines for publishing data for local governments in the uk, January 2016. http://www.local.gov.uk/practitioners-guides-to-publishing- data.
[5] Rong-En Fan, Kai-Wei Chang, Cho-Jui Hsieh, Xiang-Rui Wang, and Chih-Jen Lin. LIBLINEAR: A library for large linear classification. Journal of Machine Learning Research, 9:1871–1874, 2008.
[6] Brad Green and Shyam Seshadri.AngularJS. O’Reilly Media, Inc., 1st edition, 2013. [7] C. Ireland, D. Bowers, M. Newton, and K. Waugh. A classification of object- relational impedance mismatch. In Advances in Databases, Knowledge, and Data Applications, 2009. DBKDA ’09. First International Conference on, pages 36–43, March 2009.
[8] Svetlana Kiritchenko, Stan Matwin, Richard Nock, and A.Fazel Famili. Learning and evaluation in the presence of class hierarchies: Application to text categorization. In Luc Lamontagne and Mario Marchand, editors, Advances in Artificial Intelligence, volume 4013 ofLecture Notes in Computer Science, pages 395–406. Springer Berlin Heidelberg, 2006.
[9] David D. Lewis, Yiming Yang, Tony G. Rose, and Fan Li. Rcv1: A new bench- mark collection for text categorization research. J. Mach. Learn. Res., 5:361–397, December 2004.
BIBLIOGRAPHY
[10] Lovisa B. Skeppe. Classify swedish bank transactions with early and late fusion techniques, January 2015. http://www.diva- portal.org/smash/get/diva2:766162/FULLTEXT01.pdf.
[11] W. McDonough and M. Braungart. Cradle to Cradle: Remaking the Way We Make Things. Farrar, Straus and Giroux, 2010.
[12] Xiangrui Meng, Joseph K. Bradley, Burak Yavuz, Evan R. Sparks, Shivaram Venkataraman, Davies Liu, Jeremy Freeman, D. B. Tsai, Manish Amde, Sean Owen, Doris Xin, Reynold Xin, Michael J. Franklin, Reza Zadeh, Matei Zaharia, and Ameet Talwalkar. Mllib: Machine learning in apache spark. CoRR, abs/1505.06807, 2015. [13] Ronald E. Miller and Peter D. Blair. Input-Output Analysis. Cambridge University
Press, 2009.
[14] P. Muennig and M. Bounthavong.Cost-Effectiveness Analysis in Health: A Practical Approach. Wiley, 2016.
[15] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blon- del, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
[16] J. Russell and R. Cohn. Rabbitmq. Book on Demand, 2012.
[17] Pramod J Sadalage and Martin Fowler.NoSQL distilled: a brief guide to the emerging world of polyglot persistence. Pearson Education, 2012.
[18] Burr Settles and Mark Craven. An analysis of active learning strategies for sequence labeling tasks. InProceedings of the Conference on Empirical Methods in Natural Language Processing, EMNLP ’08, pages 1070–1079, Stroudsburg, PA, USA, 2008. Association for Computational Linguistics.
[19] Aihua Shen, Rencheng Tong, and Yaochen Deng. Application of classification mod- els on credit card fraud detection. InService Systems and Service Management, 2007 International Conference on, pages 1–4, June 2007.
[20] Solid IT. Db-engines ranking, January 2016. http://db-engines.com/en/ranking. [21] Lambert M. Surhone, Mariam T. Tennoe, and Susan F. Henssonow. Node.Js. Be-
tascript Publishing, Mauritius, 2010.
[22] Stefan Tilkov and Steve Vinoski. Node. js: Using javascript to build high- performance network programs. IEEE Internet Computing, 14(6):80, 2010.
[23] Visa. Visa merchant data standards manual 2015, 2015. https://usa.visa.com/dam/VCOM/download/merchants/visa-merchant-data-
BIBLIOGRAPHY
[24] Matei Zaharia, Mosharaf Chowdhury, Michael J. Franklin, Scott Shenker, and Ion Stoica. Spark: Cluster computing with working sets. In Proceedings of the 2Nd USENIX Conference on Hot Topics in Cloud Computing, HotCloud’10, pages 10– 10, Berkeley, CA, USA, 2010. USENIX Association.
Appendix A
Metrics
This appendix defines the various metrics used to specify the results. Define the class, or label, set as
L={0,1, . . . ,M−1}
The true output vectoryconsists ofN elements y0,y1, . . . ,yN−1 ∈L
A multiclass prediction algorithm generates a prediction vector ˆyofN elements ˆ
y0,yˆ1, . . . ,yNˆ −1 ∈L
For this section, a modified delta function ˆδ(x) will prove useful ˆ δ(x)= 1 ifx= 0, 0 otherwise. Confusion Matrix: Ci j = N−1 X k=0 ˆ δ(yk−i)·δˆ(ˆyk−j) PN−1 k=0 δˆ(yk−1)·δˆ(ˆyk −1) . . . PkN=−01δˆ(yk −1)·δˆ(ˆyk−N) .. . . .. ... PN−1 k=0 δˆ(yk−N)·δˆ(ˆyk−1) . . . P N−1 k=0 δˆ(yk −N)·δˆ(ˆyk −N) Overall Precision: PPV = T P T P+FP = 1 N N−1 X i=0 ˆ δ(ˆyi −yi)
A. Metrics Overall Recall: T PR = T P T P+FN = 1 N N−1 X i=0 ˆ δ(ˆyi −yi) Overall F1-measure: F1= 2· PPV ·T PR PPV +T PR ! Precision by label: PPV()= T P T P+FP = PN−1 i=0 δˆ(ˆyi−)·δˆ(yi −) PN−1 i=0 δˆ(ˆyi −) Recall by label: T PR()= T P P = PN−1 i=0 δˆ(ˆyi−)·δˆ(yi−) PN−1 i=0 δˆ(yi−) F-measure by label: F(β,)= 1+β2· PPV()·T PR() β2·PPV()+T PR() ! Weighted precision: PPVw = 1 N X ∈LPPV()· N−1 X i=0 ˆ δ(yi −) Weighted recall: T PRw = 1 N X ∈LT PR()· N−1 X i=0 ˆ δ(yi−) Weighted F-measure: Fw(β)= 1 N X ∈LF(β,)· N−1 X i=0 ˆ δ(yi−)
Med växande miljöhot så blir det allt mer viktigt att vi alla minimerar vår
miljöpåverkan. För att förenkla detta har vi utvecklat en app som kan räkna ut
miljöpåverkan genom en användares bankutdrag.
Dagens konsumtion bidrar till den globala uppvärm- ningen, och alla möjliga typer av miljöföroreningar. Detta gäller även för varor som vi tar för givet, såsom vatten. Vatten är en bristvara och 1,2 miljarder männ- iskor i världen lever i områden med brist på vatten. Det- ta leder till lidande för både människor, djur och natur. Allt detta gör att det finns många anledningar till varför både företag och vanliga konsumenter bör minska sin miljöpåverkan.
Vi som tillhör den 10 % rikaste delen av världen har dock också störst möjlighet att göra någonting åt detta. Mycket p.g.a. våra ekonomiska muskler, men också till följd av vår höga konsumtion. Exempelvis så genererar vi direkt och indirekt 50 % av världens koldioxidut- släpp.
För att kunna minska vår miljöpåverkan så utveckla- de jag i samarbete med Meta Mind, en app för att enkelt kunna ta reda på vilka negativa konsekvenser våra inköp har, samt vidden av dessa konsekvenser. Hur förhåller sig till exempel ett inköp av ett klädesplagg mot en liter bensin? Brist på kunskap leder till att vi kan överskatta hur stor påverkan ett inköp har, och därmed undvika det i onödan. Eller tvärtom underskatta hur stor påver- kan inköpet faktiskt har och därmed riskera att missa ett tillfälle att reducera vår miljöpåverkan. Då vi alla har olika prioriteringar och förutsättningar så är det svårt att ge konkreta råd. Vissa kan vara villiga att skippa årets
flygresa, medan andra hellre undviker att köpa kött. Appen ger därmed både individen och företaget själva mer makt att ta informerade beslut för att minska sin miljöpåverkan.
Specifikt så läggs först bankutdragen med alla inköp in i systemet. Inköpen kategoriseras sedan utifrån för- säljningskategori, såsom elektronikaffär eller restaurang, varpå systemet sedan approximerar vilka specifika typer av produkter och tjänster som har inköpts. Genom att hämta vad dessa produkter och tjänster har för påver- kan från vår databas så kan en estimering av inköpens miljöpåverkan och andra etiska konsekvenser räknas ut. Detta kan bl.a. vara miljöpåverkan som land- och vat- tenanvändning eller koldioxid men även mer etisk på- verkan som antalet människor (i antal livsår) eller djur- liv som fått sina liv förkortade till följd av användarens konsumtion.
Mitt fokus för examensarbetet var att kategorisera alla inköp med hjälp av en form av artificiell intelligens, kallad maskininlärning. Under examensarbetet lärde jag programvaran att känna igen inköp utefter vad som står i beskrivningen för varje bankutdrag.
Appen är i nuläget i alfastadiet men kommer att fin- nas tillgänglig på både webben, mobilen och surfplattan. Betaversionen släpps snart! Håll utkik på Meta Minds hemsida (www.metamind.se) för mer information.
EXAMENSARBETE Analysis of Financial Transactions using Machine Learning
STUDENT Adam Wamai Egesa
HANDLEDARE Pierre Nugues (LTH), Marcus Klang (LTH)
EXAMINATOR Jacek Malec (LTH)
Se din miljöpåverkan genom bankutdraget
POPULÄRVETENSKAPLIG SAMMANFATTNINGAdam Wamai Egesa