scieee AI-readable full text Open interactive document viewer

Complex data visualizer

Terrado González, Narcís

Full text

Complex Data Visualizer Narc´ıs Terrado Bachelor thesis Specialization in Computing Director: Llu´ıs A. Belanche Mu˜noz GEP Tutor: Eguiguren Huerta Marcos March 2021 Contents 1 Context and scope 4 1.1 Introduction and contextualization . . . . . . . . . . . . . . . 4 1.1.1 Context .......................... 5 1.1.2 Concepts.......................... 5 1.1.3 Problem to be solved . . . . . . . . . . . . . . . . . . . 6 1.1.4 Stakeholders........................ 7 1.2 Motivation............................. 7 1.2.1 Previous Studies . . . . . . . . . . . . . . . . . . . . . 7 1.2.2 Justification........................ 8 1.3 Scope ............................... 9 1.3.1 Objectives......................... 9 1.3.2 Requirements ....................... 10 1.3.3 Potential obstacles and risks . . . . . . . . . . . . . . . 11 1.4 Methodology and rigor . . . . . . . . . . . . . . . . . . . . . . 12 1.4.1 Methodology ....................... 12 1.4.2 Monitoring tools and version control . . . . . . . . . . 13 2 Project Planning 13 2.1 Taskdefinition .......................... 13 2.2 Resources ............................. 16 2.2.1 Human resources . . . . . . . . . . . . . . . . . . . . . 16 2.2.2 Hardware resources . . . . . . . . . . . . . . . . . . . . 16 2.2.3 Software resources . . . . . . . . . . . . . . . . . . . . 17 2.2.4 Material resources . . . . . . . . . . . . . . . . . . . . 17 2.3 Riskmanagement......................... 17 2.4 Ganttdiagram .......................... 21 3 Budget and Sustainability 22 3.1 Budget............................... 22 3.1.1 Personnel costs per activity . . . . . . . . . . . . . . . 22 3.1.2 Genericcosts ....................... 26 3.1.3 Othercosts ........................ 27 3.1.4 Totalcost ......................... 28 3.1.5 Management control . . . . . . . . . . . . . . . . . . . 28 3.2 Sustainability ........................... 29 1 3.2.1 Self-assessment . . . . . . . . . . . . . . . . . . . . . . 29 3.2.2 Economic impact . . . . . . . . . . . . . . . . . . . . . 30 3.2.3 Environmental impact . . . . . . . . . . . . . . . . . . 30 3.2.4 Socialimpact ....................... 31 4 Complex Data 32 4.1 Missingdata............................ 33 4.2 Numerical and Categorical data . . . . . . . . . . . . . . . . . 34 5 Dimensionality Reduction 36 5.1 Curse of Dimensionality . . . . . . . . . . . . . . . . . . . . . 36 5.2 Linear Dimensionality Reduction . . . . . . . . . . . . . . . . 37 5.3 Non-linear Dimensionality Reduction . . . . . . . . . . . . . . 38 6 Data Visualization Methods 39 6.1 Principal Component Analysis . . . . . . . . . . . . . . . . . . 39 6.1.1 Eigenvectors and eigenvalues in PCA . . . . . . . . . . 40 6.1.2 Singular Value Decomposition in PCA . . . . . . . . . 41 6.2 Linear Discriminant Analysis . . . . . . . . . . . . . . . . . . 42 6.3 Multiple Correspondence Analysis . . . . . . . . . . . . . . . . 45 6.3.1 Correspondence Analysis . . . . . . . . . . . . . . . . . 45 6.4 KernelPCA............................ 47 6.4.1 Kernel Functions . . . . . . . . . . . . . . . . . . . . . 48 6.5 t-Distributed Stochastic Neighbor Embedding . . . . . . . . . 50 6.6 Multi-Dimensional Scaling . . . . . . . . . . . . . . . . . . . . 53 6.6.1 MetricMDS........................ 53 6.6.2 Non-Metric MDS . . . . . . . . . . . . . . . . . . . . . 54 7 Visualization 55 7.1 MNISTdataset .......................... 55 7.2 Indian Pines dataset . . . . . . . . . . . . . . . . . . . . . . . 62 7.3 Categorical Variables with MCA . . . . . . . . . . . . . . . . . 67 8 Conclusions 71 A User Manual 71 2 List of Figures 1 Ganttdiagram .......................... 21 2 Classifier performance as a function of the number of dimensions 37 3 Visual outline of the projection of the original samples on the lower dimensional space found by LDA. Xis the original data. Vkis the lower dimensional space. ωiis class i......... 42 4 PCA result of the MNIST dataset in 2 dimensions . . . . . . . 56 5 LDA result of the MNIST dataset in 2 dimensions . . . . . . . 57 6 LDA result of the MNIST dataset in 3 dimensions . . . . . . . 58 7 Kernel PCA result of the MNIST dataset in 2 dimensions . . . 59 8 t-SNE result of the MNIST dataset in 2 dimensions . . . . . . 61 10 MDS result of the MNIST dataset in 2 dimensions . . . . . . . 62 11 PCA result of the Indian Pine dataset in 2 dimensions . . . . 63 12 LDA result of the Indian Pine dataset in 2 dimensions . . . . 64 13 Kernel PCA result of the Indian Pine dataset in 2 dimensions 65 14 t-SNE result of the Indian Pine dataset in 2 dimensions . . . . 66 15 MDS result of the Indian Pine dataset in 2 dimensions . . . . 67 16 MCA result of the Mushroom dataset in 3 dimensions . . . . . 69 17 MCA result of the Soybeans dataset in 2 dimensions . . . . . 70 18 Upload view of the web application . . . . . . . . . . . . . . . 72 19 Sidebar links of the web application . . . . . . . . . . . . . . . 73 20 Parameters for the Kernel PCA method . . . . . . . . . . . . 74 List of Tables 1 Summary of the information of the tasks . . . . . . . . . . . . 19 2 Annual salary for the different project roles. Estimated hours worked per day is 1750. Information from: [1] GEPT: GEP Tutor D: Director R: Researcher . . . . . . . . . . . . . . . . . 23 3 Cost for each member of the personnel . . . . . . . . . . . . . 24 4 Generic cost of the project . . . . . . . . . . . . . . . . . . . . 27 5 Incidental cost of the project . . . . . . . . . . . . . . . . . . . 28 6 Total cost of the project . . . . . . . . . . . . . . . . . . . . . 28 3 1 Context and scope 1.1 Introduction and contextualization Given that the human mind is very visual, data visualization has been a need since the times when humans strived for survival. They kept statistics of how many animals and what kind they caught and envisioned hunting strategies [12]. We’ve come a long way since then, and we created some methods to improve the quality of the visualizations that we use, making them more useful. In the last years, we used the computational power to make data visualization available to almost every field imaginable. The need to visualize data has not declined with time, on the contrary, given the amount of data generated nowadays thanks to computers it may be arguable that it is more needed than ever. We say that because lately, the amount of data generated by organizations around the world has increased greatly, as a result, the amount of data available has also increased dramatically. Data visualization is concerned with the design, development, and application of computer generated graphical representation of the data. This graphical representation is used in a vast amount of ways to make decisions, discover patterns, comprehend information and form an opinion. As we said earlier, the human mind is very visual, it is much easier for our brain to understand graphically represented data than it is to understand raw numerical data. We use data visualization to form a visual representation of information, taking advantage of the capacity of the human eye to detect information from pictures and illustrations. With data visualization we shift from numerical reasoning to visual reasoning, which we are much more prepared to do and do faster[32]. With the arrival of newer technologies and higher computational power the data generated has become bigger and more complex, there’s more rows and more columns in our datasets and there are more types of data being used so the techniques required to graphically represent the data have become more complex too. To represent data with a high number of dimensions is complicated, and without the proper tools it is hard to make a visualization in which the user can extract the correct information. That’s why one of the biggest challenges 4 in data visualization is to find general representations of data that can display multiple variables at the same time. 1.1.1 Context This is a Bachelor Thesis of the Computer Engineering Degree, specialization in Computing, done in the Facultat d’Inform`atica de Barcelona of the Universitat Polit`ecnica de Catalunya. 1.1.2 Concepts To fully understand the scope of this project we first need to define some concepts. We will talk more in depth about them later in the work, but for now we introduce the concepts. Data Generally, data is described as distinct pieces of information formatted and stored in a way that serves a purpose. We could define data as information transformed in a way that we can use. When we talk about complex data in this work we usually refer to high dimensional datasets. A high dimensional dataset is commonly modeled as a point cloud embedded in a high-dimensional space, with the values of the attributes corresponding to the coordinates of the points[34]. All these factors make the data more difficult to operate, and so, it is more complicated to transform into something we can use and understand. We will also limit our scope to table-based datasets, forgetting about graph or network datasets. Data Visualization Data visualization is the presentation of data in a graphical format so that it is easily understandable. It is a way to present information in a certain way so that we can identify and explain patterns. It can be roughly categorized into two applications[18]: •Exploration For this application, usually carried out by data analysts, many graphs will be used to reveal interesting and important features in the data. For this part, a high amount of interaction with the dataset is needed, 5 many plots must be created, many modifications like sorting or rescaling are to be performed and performed fast in order to not disturb the data analyst train of thought. •Presentation Once the exploration phase is over and key findings have been done in a dataset, it comes the time to present this findings to a broader audience. This graphics usually aren’t interactive as they have usually have to be suitable for printing. High dimensional plots are not often used given the complexity to understand them. Dimensionality Reduction Given that it is not feasible to plot more than three dimensions, there are methods that allow to represent more than two dimension graphically and others that reduce the dimensionality of the data to two or three. The later methods objective is to represent the data in a lower dimension while keeping the relevant information. Methods for dimensionality reduction fall into two categories, linear and non-linear methods. As the name implies, the linear dimensionality reduction methods find a linear relation between variables to reduce the dimensionality. Some examples of linear methods are Principal Component Analysis (PCA), Linear Discriminant Analysis (LDA) and Multidimensional Scaling (MDS) [19]. The non-linear methods find non-linear relations in the data and are a bit more complicated but the result still the same, reduce the dimensionality of a dataset in order to properly visualize it. Some non-linear methods are the kernel-PCA (a modification of the linear method PCA that uses a kernel to find non-linear relations) and t-distributed Stochastic Neighbour Embedding (t-SNE). 1.1.3 Problem to be solved As we have seen in previous sections, data visualization is not a new topic. However, it is in constant development and it advances with other fields, as it serves as a support. In this thesis we want to develop a web based complex data visualizer. We also know that this is not new, but we want to make our version tackling some of the problems that we talked about in previous sections. One of this problems would be high dimensionality in data, which we saw that it can be approached in two different ways: User Interaction and 6 Dimensionality reduction. One of the goals of this project is to make an interactive, usable and pretty web User Interface for data visualization. This will tackle the part of User Interaction to make the complex data usable. We will also allow the use of dimensionality reduction techniques to the user, making it easier to use methods that are sometimes complex to use. A comprehensive breakdown of the objectives can be found in section 1.3.1 1.1.4 Stakeholders There are not many parties involved in this project. They can be categorized into two main groups depending on the interaction with the project in it’s development. The tutor and researcher are stakeholders that have direct interaction with the project development. The tutor it’s Llu´ıs A. Belanche Mu˜noz, professor in Facultat d’Inform`atica de Barcelona and part of the Soft Computing Research Group (SOCO). He will be guiding and leading me through the development of the thesis. He is the one who proposed the project, so he has been the one to define most of the requirements. As he is investigating at UPC, this project will probably be of use for him, given his areas of research. The other stakeholder directly involved is the researcher, Narc´ıs Terrado Gonz´alez, me, who is responsible for the planning, documenting and developing the project. For indirect stakeholders we have the scientific community, who, just like the tutor of this project, may be interested in having this kind of data visualizing took to aid it’s research. We could also count companies that use some kind of data visualizer as indirect stakeholders that receive benefits from this project 1.2 Motivation 1.2.1 Previous Studies In the past decade a variety of approaches have been introduced to express the information found in high dimensional datasets. Some of this approaches may be dimensionality reduction, visual encoding and interactive exploration. 7 S. Liu et al. have gathered most of the advances in this field in ”Visualizing High-Dimensional Data: Advances in the Past Decade”[34]. We will focus only in some of the advances made because there are a lot of them that are not directly related to this work. The article talks about the different dimensionality reduction methods that we wrote about earlier and how do they work. We will not explain them as it is not within the scope of this work to explain every method thoroughly. We will talk, however, about some of the improvements and extensions made to this methods. In the case of Principal Component Analysis (PCA), we have interactive-PCA, which introduces a system that visualizes the results of PCA and allows for some interaction and can be used to better understand the PCA method and the dataset itself. The article also talks about how user interaction is playing an important role in the development of high dimensional data visualization: Interactive filtering, zooming, distortion, linking or a combination of them have been adopted as part of the exploring process of data visualization. A lot of other methods can also be found in the article, but they are way too many to mention all of them. I will, however, mention some new methods and fields of study that have surged in the last years. Topological Data Analysis (TDA), which is a new field of study [29],has provided efficient and reliable feature-driven analysis and visualization capabilities. It provides a meaningful abstraction from high dimensional data. In the field of Machine Learning, data visualization has made efforts to understand the black box that Machine Learning models usually are. Visualization systems of neural networks that make it’s design more efficient and understandable[21]. Visualization methods for interactively construct and analyze decision trees[41]. 1.2.2 Justification As we commented many times earlier in previous sections, data visualization is useful in a lot of fields of study. It helps other fields progress and at the same time, other fields make data visualization better. The methods that we commented so far are the theoretical frame to make complex data visualization possible. We have means to achieve our ends, and so, we must put this theory into practice. In order to make a complex data visualizer we need the methods we talked in previous sections to serve as a base for us to build our visualizer on. The use of some of the methods 8 Practical implementation •Learn Dash We will be taking some time to learn Dash, the python framework that will help us build the web based visualizer. We have to learn it beforehand in order to familiarize myself with it before starting with the visualizer. This will also include learn CSS, which Dash and I have never used. It is quite a few work, so we assigned 50 hours to this task to ensure we have learned enough to complete the rest of the tasks. •Use data visualization techniques To develop the visualizer we will need to apply the techniques we learned during our research in data visualization. This will take a good amount of time because I have no experience in this field, so we assign 50 hours to this task to ensure we end up using these techniques successfully. •Use dimensionality reduction methods We will use the dimensionality reduction methods we learned. As we have no experience in this, we will assign 50 hours to properly use this methods. •Implement the use of some kernel functions for dimensionality reduction For the dimensionality reduction we will let the user choose between some kernel functions, and this needs to be implemented correctly. Once we learned the dimensionality reduction methods we will need to implement some kernel functions for the user to use. For this, we assigned 25 hours as we will already have some knowledge after researching the state-of-the-art and implementing the dimensionality reduction methods. •Implement user interaction The user needs to interact with the data, we need to implement this interaction. As this does not seem extremely complicated to make with Dash, we assigned 25 hours to it. 15 •Design the UI In order to make our program better we will be dedicating some time to design a fast, clean and usable UI. We don’t think this will take much time, so we assign 25 hours to it even though we have no experience. •Testing We need to assign some time to testing the program that we are building in order to make it usable. For this tool testing is quite important to make the experience enjoyable, so 50 hours seems fit. Given that our thesis is not about research we don’t need to extract a direct conclusion from it, so we will have no tasks for experimentation or analysis. There is two implicit tasks to be done, the documentation and the preparation for the oral defense. 2.2 Resources To carry out a correct development of the project we need some resources. This resources have been divided into four groups 2.2.1 Human resources For this project we have three people that fall into this type of resources. First, we have the researcher, who is responsible for planning, developing and testing the project. There is also the director of the project which is responsible for leading and guiding the researcher for the correct development of the project. Lastly, we have the GEP tutor, who is in charge of helping the researcher do the planning for the project during the first month of its development. 2.2.2 Hardware resources In this group of resources we have our computer, which is quite essential for the development of the project. We will be using a TUXEDO InfinityBook Pro 15 with 16 GB of RAM, Intel(R) Core(TM) i7-10510U. We also have to take into account all the resources connecting the laptop to the network (e.g the router). We also use a mouse and maybe some USB memory to share files. 16 2.2.3 Software resources We will use multiple resources for this group, and each will fill a specific need in the development. First, if we have to schedule a meeting with the director we will use Google Meet. To manage the code of the project we will use GitHub, where it will be secure and available in case of a local loss. For the programming part we will use Python as our primary language given that we will be using the Dash framework to create the web interface. We may use other programming languages for other purposes but for the moment we will keep Python as the only language used. For the documentation we will use Overleaf or TeXmaker as our text editor. We may swap to one or another depending on the size of the document. 2.2.4 Material resources In this kind of project there is always the need to gather knowledge, we will be doing that from books and papers. 2.3 Risk management We introduced the potential risks for the project in section 1.3.3. Now we will also assign a risk level to each risk and we will present how can we solve them once we encounter them. •Deadline of the project [High risk] In case we have made a bad temporal planning of the tasks to complete the project in time, we will need to readjust the planning once we are more deep into the project. If we still don’t meet the deadline, we will create a task of 20 hours to solve the problem we face. •Inexperience [Medium risk] We do not have expertise in every piece of software that we will use, and that may be a risk. We planned the tasks so that we assign a lot of time for learning the tools that we need to use, but it may not be enough. In case of seeing that we are not reaching the required knowledge to finish the project we will assign more time to learn the software needed. If we cannot assign more time for some reason we will reduce the hours of some other task to make it possible. 17 •Coronavirus [Low risk] Given that it’s been some time since the start of the pandemic, we are prepared to continue working on the project even if the pandemic causes the country to go under a confinement again. We have already overestimated the amount of hours in the majority of the tasks in order to avoid some of the risks. 18 ID Name Time(h) Dependencies T1 Project Management 94 T1.1 ICT tools to support project and team management 4 T1.2 Context and scope 25 T2 T1.3 Project Planning 10 T1.4 Budget and sustainability 15 T1.3 T1.5 Final project definition 20 T1.2, T1.3, T1.3 T2 Study of the state-of-the-art 72 T2.1 Data visualization 36 T2.2 Dimensionality reduction 36 T3 Practical implementation 300 T2 T3.1 Learn Dash 50 T3.2 Use data visualization techniques 50 T3.3 Use dimensionality reduction methods 50 T3.4 Implement the use of some kernel functions for dimensionality reduction 25 T3.5 Implement user interaction 25 T3.6 Design the UI 25 T3.7 Testing 50 T4 Project Documentation 76 T5 Bachelor thesis defense preparation 20 Total 537 Table 1: Summary of the information of the tasks 19 2.4 Gantt diagram Figure 1: Gantt diagram 3 Budget and Sustainability In this section we will lay out the economic part of the project. We will talk about the budget for the project, which will include the personnel costs, generic costs and other costs. There will also be some management control mechanisms in order to be prepared for some unforeseen event. 3.1 Budget 3.1.1 Personnel costs per activity Here we will compute the total cost for each task defined in the previous section. The cost of one task is computed by summing the cost of the workers. Then, for each worker we will compute the cost by multiplying his cost per hour by the amount of time that worker needs to work on that task. We can define 5 types of workers that would be used to develop this project, however, they will all be impersonated by me, the director of the project or the GEP tutor. First we have the project manager, who is responsible for the proper planning and correct development of the project. This role will be carried out by the GEP tutor and me. We also need a programmer and a tester, which task will consist in programming the code and verifying its correct functioning. This roles will be played only by me. Finally we will need a technical writer that will document everything regarding the development and the results. This role will also be played by me. In table 2 we show the annual salary for each of this roles. And we have computed the total cost for the personnel in table 3 With this information we will be able to compute the cost per task. 22 Role Annual Salary (€) Total including SS (€) Price per hour (€) Role played by Project manager 39.004 50.705,2 28,97 GEPT, D, R Programmer 26.198 34.057,4 19,46 R Tester 20.592 26.769,6 15,29 R Technical writer 26.263 34.141,9 19,50 R Table 2: Annual salary for the different project roles. Estimated hours worked per day is 1750. Information from: [1] GEPT: GEP Tutor D: Director R: Researcher 23 ID Name Total Hours Hours Cost (€) Project manager Programmer Tester Technical writer T1 Project Management 94 94 0 0 0 2.723,18 T1.1 ICT tool to support project and team management 4 4 0 0 0 115,88 T1.2 Context and scope 25 25 0 0 0 724,25 T1.3 Project Planning 10 10 0 0 0 289,7 T1.4 Budget and sustainability 15 15 0 0 0 434,55 T1.5 Final project definition 20 20 0 0 0 579,4 T2 Study of the state-of-the-art 72 0 72 0 0 1.401,12 T2.1 Data visualization 36 0 36 0 0 700,56 T2.2 Dimensionality reduction 36 0 36 0 0 700,56 T3 Practical implementation 300 0 250 50 0 5.629,5 T3.1 Learn Dash 50 0 50 0 0 973 T3.2 Use data visualization techniques 50 0 50 0 0 973 T3.3 Use dimensionality reduction methods 50 0 50 0 0 973 T3.4 Implement the use of some kernel functions for dimensionality reduction 25 0 25 0 0 486,5 T3.6 Implement user interaction 25 0 25 0 0 486,5 T3.7 Design the UI 25 0 25 0 0 486,5 T3.8 Testing 50 0 0 50 0 764,5 T4 Project Documentation 76 0 0 0 76 1.482 T5 Bachelor thesis defense preparation 20 20 0 0 0 579,4 Total 537 114 322 50 76 11.815,2 Table 3: Cost for each member of the personnel For example, if a researcher can make a good induction out of a visualization, it will not be needed to test a large amount of methods, wasting time and electricity. 3.2.4 Social impact What do you think undertaking the project has contributed to you personally? This will be my first big project and it will be the first time I work in the field of data visualization. The fact that I face a somewhat big amount of hours of work, has made me more organized and less prone to procrastination. It is also an opportunity to put into practice all the knowledge gathered through this years. How is the problem that you wish to address resolved currently (state of the art)? In what ways will your solution socially improve (quality of life) existing solutions? Is there a real need for the project? As we said repetitively, data visualization affects many fields and can indirectly address issues in other fields of study. 31 4 Complex Data We described data earlier in this work as distinct pieces of information formatted and stored in a way that serves a purpose. With this description, data could be as diverse as wanted, so we need to get a bit more specific. In this work, what we are interested about is visualizing datasets. A dataset is just a collection (a set) of data. When we talk about datasets we usually refer to a set of collected samples, organized in a table where each row is a sample and each column represents a particular variable of a sample. We list some of the properties that may make the data complex: •High dimensionality This refers to datasets with a lot of variables, which makes it very hard to visualize because we can only properly visualize data in 2 or 3 dimensions. •Missing Values Datasets with variables of some rows without values. We explain better why is this a concern in subsection 4.1 •Data Types Data can come in very different shapes and treating each of them is quite a task. In subsection 4.2 we focus on talking about categorical and numerical variables and how we treat them. Other data types would be dates, which are hard to deal with because they are often circular and may come in different formats. •Text data We can find datasets that contain documents, and we cannot process documents in the same way we process numerical and categorical variables and certainly we can not plot the data using the same methods. Documents need to be treated differently, and that’s beyond the scope of this work. •Time Series Time series is a sequence of variables collected at a regular interval during a certain period of time. This dataset type comes with at least 32 1 variable as a date, which is part of what makes it difficult to work with. Visualizing this kind of dataset is not hard, but 1 axis will always have to be the date for it to make sense. Data complexity is a bit of an ambiguous term, it can refer to a lot of things. In this work we narrowed our scope to care mostly about high-dimensional datasets. This means datasets with more than a trivial number of columns. We also tackle missing values and mixed data types (datasets containing numerical and categorical variables) in order to make the work usable, because almost any real-world dataset is going to contain missing values and it’s variables may not all be the same type. Of course we can talk about other properties of the data that make them complex, such as the sample size of a dataset, or datasets with types of data besides numerical and categorical, but these are not within the scope of this project and tackling them would require time and effort. This work then, can be considered a step towards a tool for visualizing arbitrarily complex data, where some of the issues commented above are tackled. 4.1 Missing data In real wold data we cannot always assume to have every value set. When we collect data from the world, we usually have missing values. Missing values is what we call when we have no value for a variable of a given sample. Missing data can have a significant impact on the conclusions that we draw from the data and they need to be treated carefully when working with datasets with a high rate of missing values. Missing values can also be used to draw conclusions, for example, if we are analysing the data of a survey, we might use the missing values to conclude that when a certain variable lays around certain value, the individuals are less likely to respond. We cannot always use them, and then we need to handle the missing values. In our web application we give the user two options for treating the missing data. The rows containing missing data can either be deleted or they can be imputed. If there are just a few missing values, deleting these samples might be the right choice, as not much information is lost. However, we can also impute them. Imputing means trying to guess which value corresponds to that sample, usually this is done by looking at the other samples. A very simple imputation might be setting the missing value to the value of 33 the median of that variable. In our web application, if the user uploads a dataset with missing value is given the option to impute them by using K-Nearest Neighbor Imputer (KNN Imputer)[3]. With KNN imputer each sample’s missing values are imputed using the mean value from the nearest neighbors found in the training set. Two samples are considered close if the variables that neither of them is missing are close. For the case of imputing categorical variables we use a simple imputer [4] which resolves the value for a category using the most frequent category for that variable taking into account the other variables as well. 4.2 Numerical and Categorical data Although there are more types of data than these two, in this work we only focus on numerical and categorical data because they are the most used. We also focused on them because it is easy to convert one type to the other. In our web application the user is given the option to convert the categorical variables to numerical and vice versa. We recommend, however, that the user converts the data to numerical given the nature of the dimensionality reduction methods used, which most of them accept only numerical data. Also, less information is lost when converting from categorical to numerical than it is the other way around. To convert the numerical data to categorical data we need to discretize it, create intervals for the numerical data to fit in, and convert a continuous set of data to a discrete one. In our visualizer, the user can choose to convert the numerical variables to categorical ones with the K-Bins discretizer[5], which handles this process by grouping the numerical values into bins, like in a histogram, creating this way the categories. For example: If we have a numerical variable like the score of a test that we want to discretize with value 8.5, we can create 5 categories (5 intervals of length 2). Our score of 8.5 will end up in the category [8-10]. To convert the categorical variables into numerical ones we need to encode the categories. For this we can use One Hot Encoding[6]. One Hot Encoding is a method that converts each category in the categorical variable into a new column, so each original categorical variable spans a set of new variables. Each of this sets acts as a binary array where on a given sample or row the new variables are all 0 except the one that represents the category on which the sample belongs. For example: If we have a categorical variable with two possible values: red and blue. When we apply One Hot Encoding 34 in them, we create a binary array of size two, the first value for the array will be 1 and the second 0 if that row was red and 0 first and 1 second if it was blue. We leave the high-dimensionality part for the next section, where we hope to make understand why we focused most of our work in it. 35 5 Dimensionality Reduction Dimensionality reduction techniques are important in many applications related to machine learning, data mining, bioinformatics, biometric and information retrieval. As we commented earlier in the work, dimensionality reduction is a tool that allows us to map the points of a higher dimensional data to a lower dimension while keeping relevant information within the data, allowing us to visualize it. [23] 5.1 Curse of Dimensionality To understand why we need dimensionality reduction techniques to visualize complex data we need to understand the curse of dimensionality. The essence of it it’s that a small increase in the dimensionality requires a large increase in the volume of the data to maintain performance in tasks such as clustering or regression. As the dimensionality increases, the probability of more sparse data increases due to the input space growing exponentially with respect to the dimensionality. This causes the degradation of the performance in problems depending on said input space such as classification as we can see in Figure 2. [43] 36 Figure 2: Classifier performance as a function of the number of dimensions This problem starts at the data gathering, where we obtain noisy or redundant dimensions that barely bring any information, thus resulting in an increase in the dimensionality without any significant benefit. This work will explain some of the methods used to deal with this curse. Dimensionality reduction techniques are divided into two main categories depending on the function to optimize. Convex techniques optimize an objective function that does not contain any local optima, whereas non-convex techniques optimize objective functions that do contain local optima. In this work we did not focus on these two categories and we divided the methods used into linear and non-linear methods, this way we do not focus on the function to optimize and we can focus on the transformation of the data, which is a more practical approach. 5.2 Linear Dimensionality Reduction Linear dimensionality reduction methods have been developed throughout statistics, machine learning, and applied fields for over a century, and these 37 methods have become indispensable tools for analyzing high dimensional, noisy data. These methods produce a low-dimensional linear mapping of the original data while preserving most of the information. As such, it can be used for visualizing or exploring structure in data, denoising or compressing data. Cunningham and Ghahramani [30] provided a very general definition of the linear dimensionality reduction as: Given a data matrix X∈Rd×nand a choice of dimensionality r < d, optimize an objective function fX(·) to produce a linear transformation P∈Rr×d, and call Y=PX ∈Rr×nthe low-dimensional transformed data. To simplify a lot without doing a massive deep dive into the mathematics behind linear algebra, to reduce the dimensionality of a matrix A we need to multiply it by a vector/matrix X such that the product is B. So AX =B will have a solution if and only if B is a linear combination of A. 5.3 Non-linear Dimensionality Reduction The non-linear dimensionality reduction methods can be explained similarly as the linear methods. The difference, as the name implies, is that the transformation applied on the data is not a linear one. So we are not looking for a linear function to transform our data, and that makes it a bit more complicated. The end goal is still the same, we need to transform a given dataset Xwith dimensionality Dinto a new dataset Ywith dimensionality d(with d<D, and most times dD) while retaining the geometry of the original data as much as possible. [35] There are a lot of different kinds of dimensionality reduction techniques and we will be working with a few of them. In the next chapter we will be seeing some methods used for linear dimensionality reduction and how we used them for high-dimensional data visualization. 38 6 Data Visualization Methods For this thesis we used six different methods that will allow us to visualize high-dimensional data by reducing the dimensionality. We will explain briefly how the methods work. 6.1 Principal Component Analysis Principal Component Analysis (PCA) is a useful statistical unsupervised technique that has found application in fields such as face recognition and image compression, and is a common technique for finding patterns in data of high dimension. [40] As we can imagine, PCA is used for dimensionality reduction. It is a technique for reducing the dimensionality of datasets, increasing interpretability but at the same time minimizing information loss. It does so by creating new uncorrelated variables that successively maximize variance, preserving as much variability as possible. This means that PCA finds new variables that are linear functions of those in the original data that are uncorrelated to each other. Finding these new variables (Principal Components) reduces to solving an eigenvalue/eigenvector problem and (more recently) Singular Value Decomposition (SVD) is used as a more general solution. As the Principal Components are dependent on the data and are not predefined and makes no assumptions on the distribution of the data, this method is highly adaptive but at the same time, it makes it very sensitive to the presence of outliers. It also is a non-parametric analysis, meaning There are no parameters to tweak and no coefficients to adjust based on user experience the answer is unique and independent of the user. [39] Although PCA is more than a 100 years old, it resurfaced again due to the available computational power of modern computers, which make it feasible to use on non-trivial datasets. Since the creation, a large number of variants and improvements have been developed in many different disciplines. PCA can be used with the covariance matrix or the correlation matrix. As it is defined by variance, which depends on units of measurement, a Principal Component based on the covariance matrix will change if we change the units of measurements of one or more variables. As this is not desirable, it is common practice to standardize variables, so the original data matrix is changed to contain standardized values. Since the covariance matrix of a standardized dataset is merely the correlation matrix of the original dataset, 39 a PCA on the standardized data is also known as a correlation matrix PCA. The correlation matrix Principal Components are not the same and are not related to the original covariance matrix PC. The percentage variance accounted for by each PC will differ and frequently more correlation matrix PCs than covariance matrix PCs are needed to account for the same percentage of total variance [31]. Correlation matrix PCs are invariant to linear changes in units of measurement, then they are the appropriate choice for datasets with changes of scale. 6.1.1 Eigenvectors and eigenvalues in PCA As you know, you can multiply two matrices together, provided they are compatible sizes. Eigenvectors are a special case of this. If you multiply a matrix on the left of a vector, the result is another vector that is transformed from it’s original position. All the eigenvectors of a matrix are orthogonal to each other (in a n×nmatrix there are at most neigenvectors). As the length of a vector does not not determine if it is an eigenvector, so we usually use the length 1 or unit eigenvector. Every eigenvector comes with an eigenvalue associated which tells us the factor by which the eigenvalue is scaled. This process is called eigendecomposition, and we can only perform it in square matrices. The next subsection talks about a generalization of this process. We can use the eigenvectors of a covariance or correlation matrix to be able to extract useful information that can allow us to characterise the data. And then we can express the data in terms of those eigenvectors by transforming it. In PCA, once we get the eigenvectors with it’s eigenvalues we will choose the eigenvector with the highest eigenvalue, and we will call that the Principal Component 1. And the same will be done with the other components. By doing this we are taking the eigenvalue that explains the data best and this way we will be minimizing the information loss. This can translate as finding a linear basis of reduced dimensionality in which the amount of variance in the data is maximal. We are creating a new coordinate system with the principal components, we then translate our data into this new coordinate system with a lower dimensionality that preserves most of the information. As we can only perform eigendecomposition with square matrices, we cannot explore most of the existent new coordinate systems 40 6.4 Kernel PCA We now start with the non-linear dimensionality reduction methods. We begin with Kernel PCA, an extension of the method already explained in Section 6.1. With PCA we could find a lower dimensional space which was a linear combination of the previous space. However, if the data does not lay in a linear space PCA cannot really find the relations between the data. This is where Kernel PCA is useful. The standard steps for Kernel PCA follow as: First, we assume a nonlinear transformation φ(x) that transforms from our original D-dimensional space to an M-dimensional space where DM. Then, the naive approach would be to apply PCA to this new dimensional space and find linear combinations there. This can be costly and inefficient. We can use kernel methods to simplify the computations needed. We first assume that the projected new features have zero mean. This means: 1 N N X i=1 φ(xi)=0 Then we compute the covariance matrix of the projected features Cas: C=1 N N X i=1 φ(xi)φ(xi)T And as we know, we can compute the eigenvalues and eigenvectors as: Cvk=λkvk Now, if we define a kernel function κ(xi, xj) = φ(xi)Tφ(xj) and multiply by φ(xl)Tboth sides of the previous equation we can use matrix notation to get: K2ak=λkNKak where Kij is the kernel function defined earlier for iand j, and akis the N-dimensional column vector. We can now compute the kernel principal components as: yk(x) = φ(x)Tvk= N X j=1 akiκ(x, xi) 47 We can see that this is a bit more complicated than the linear version, but it is powerful, and it can be understood better with a correct understanding of what kernel functions are. We can see that the steps on the this section are not trivial, and it may seem that we are not getting where we want, but we are basically transforming the data to a higher dimensional space where we can find linear separations for our data. If we were to apply PCA to a N×Ndot product matrix we would still need to evaluate the dot products in a very high dimensional space to compute the entries of the matrix even when a diagonalization may be tractable, it would not be enough. Kernel PCA does not compute all dimensions in the feature space so we can avoid this problem. It chooses an adequate subspace inside the feature space, taking advantage of this lower dimensionality by working only on a relevant subset of the feature space (we could say that it only works with the features that it deems most important. Kernel PCA has the property of unitary invariance, due to the fact that both the eigenvalue problem and the feature extraction depend on only kernel values. This ensures that the features extracted do not depend on which orthonormal coordinate system we use for representing our input data. 6.4.1 Kernel Functions So, we need to transform our data to a higher dimensional space where the data can be linearly separated. This seems like a very complex operation, given that we are converting points in the input space of the data to a much higher and much complex dimensional space. Kernel functions allow us to make this mapping of the input to a higher dimensional space with very reduced computations by only computing the dot product between the mapped patterns, and not the patterns itself. We represent the computation of the dot product as a kernel function like: κ(x, y) = φ(x)·φ(y), which allows us to compute the dot product in the feature space without explicitly having to use φ. Through a kernel function we can represent the dot product between elements in the feature space in terms of elements in the input space. Often, the feature space has a very high dimension, so we would like to find an expression for κthat can be efficiently computed because all the computations needed are done in input space instead of the much higher dimensional feature space. Choosing a κwithout being concerned with the mapping of φinto the 48 feature space might correspond to a dot product between patterns mapped with a suitable φ. This means we need to work solely in terms of the dot products without needing φ. This is useful because φis probably very high dimensional, and so, computations are costly. We can see that this has some restrictions, as we are hoping to find a kernel function that allows us to skip the computations to do the mapping φand we can assume that most kernel functions will not have this property. However, Mercer’s Theorem [38] implies that if k is a continuous kernel of a positive integral operator, there exists a mapping into a space where κacts as a dot product. So we need to be clever about choosing a kernel function for our data. 49 6.5 t-Distributed Stochastic Neighbor Embedding t-Distributed Stochastic Neighbor Embedding (t-SNE) is popular nonlinear dimensionality reduction and data visualization method. It was presented very recently (2008[36]) and it has become a very popular procedure and a state-of-the-art technique in a lot of applications. t-SNE is a iterative algorithm that allows us to visualize high dimensional data by applying dimensionality reduction, just like the methods we’ve seen until now. t-SNE is able of capturing much of the local structure of the high-dimensional data very well, while also revealing global structure such as the presence of clusters at several scales. This is something that most non-linear dimensionality reduction methods are not able to achieve in real world datasets. t-SNE starts by computing a joint probability distribution for all pairs of points in the data, creating a symmetric n×nmatrix P. In a similar fashion, it creates a two-dimensional symmetric matrix Qwith the joint probability distribution over all pairs {(yi, yj)1≤i6=j≤n}. Pand Qare similarity matrices that contain information about the distances between pairs of points in the high dimensional space (P) and the two-dimensional space (Q). Each element in Pis computed as: pij =pi|j+pj|i 2n where pj|iis: pj|i=exp(−||Xi−Xj||2 2/2τ2 i) Pkexp(−||Xi−Xk||2 2/2τ2 i)) And we define the elements of Qas: qj|i=(1 − ||yi−yj||2 2)−1 Pk,t,k6=t(1 + ||yk−yt||2 2)−1 The goal of t-SNE is to find npoints in the lower-dimensional space (yi) by solving an optimization problem where we try to minimize whats called the Kullback–Leibler divergence(KL-divergence). KL-divergence is a measure of how a probability distribution is different from a second. We can solve the optimization problem through many different methods, the most widely used is a variation of the gradient descent algorithm that includes a momentum term. This term is used to speed up the convergence and reducing the risk of 50 getting stuck in a local minimum[17]. Even with the momentum parameter we can be stuck in a position where we are very slow to find the convergence or even we are not able to achieve it in some cases. As a solution, the standard practice for the use of this method is to use a early exaggeration technique that’s applied to the early stages of the optimization which speeds up the convergence. Most of the implementations are based on an early exaggeration phase followed by the embedding stage that iterates through the gradient descent algorithm. t-SNE is made with SNE as a basis. SNE is the previous method that aimed for the same goals, but had a slightly different, less efficient approach. Specially the cost function. In t-SNE, we use a symmetric version of the cost function that SNE uses, with simpler gradients, allowing for easier, faster computations and overall optimization. It also uses t-Student distribution instead of a Gaussian distribution to compute the similarity between the points in the lower dimensional space. There’s another problem that SNE has and t-SNE solves, it is known as the crowding problem. The crowding problem occurs when we map high dimensional data into a two or three dimensional space. As t-SNE works with the distance between pairs of points, it cannot faithfully represent the high dimensional data onto a lower dimensional space. For example, if we had 10 dimensions and we were trying to map to a two dimensional space, we would run into the problem that it is possible to have 11 points that are mutually equidistant and we have no way of representing them in two dimensions. This happens because the area of the two-dimensional map that is available to accommodate moderately distant points will not be nearly large enough compared with the area available to accommodate nearby points[36]. This produces unwanted results in SNE: this problem makes it so that a lot of points will be close to each other (crowded), which prevents gaps forming between natural clusters of the data. The solution proposed is to inject a slight repulsion between points so that any distance between a pair of points cannot be below a certain threshold. Although t-SNE solves problems from SNE, it is not a perfect method and can suffer some drawbacks. The first one is how it works for dimensionality reduction not done for data visualization (i.e. dimensions >3). That is because of the heavy tails of the t-Student distribution. In high-dimensional 51 spaces, the heavy tails comprise a relatively large portion of the probability mass under the Student-t distribution, which might lead to d-dimensional data representations that do not preserve the local structure of the data. This does not bother us much because in our web application we will we only using t-SNE for data visualization. Another problem that t-SNE can encounter is when we use it with data with a high intrinsic dimensionality. This means that if we use a dataset that needs at least 4 dimensions to be properly represented, t-SNE will not bear results as good. This is caused because of the assumption that t-SNE makes that the data will be locally linear. By definition this is a problem that we will not be able to avoid fully, because it is impossible to represent the structure of the data with less dimensions than the intrinsic dimensionality of the data. The major weakness of t-SNE can be found in it’s cost function not being convex. This can mean that the method does not find a global minimum, and so, we can not get the best representation of the data in a lower dimensional space. This draws us to choose several optimization parameters and does not guarantee that every execution is the same, because we start with a random configuration of map points. 52 6.6 Multi-Dimensional Scaling Multidimensional scaling (MDS) is a classical method for generating meaningful non-linear low dimensional embeddings of high dimensional data. MDS has a long history in the statistics, machine learning, and graph drawing communities. Similar to t-SNE, MDS tries to provide a lower dimensional embedding of high dimensional data by trying to represent properly the distance between points. It’s used for the analysis of similarity of data. MDS tries to represent the proximities by distance among the points of an m-dimensional space. The most frequently used and the most natural distance function is the Euclidean distance. It corresponds to the length of the straight line segment that connects two points. MDS uses an expression as a metric of how well is the data represented in the lower dimensional space. It’s called stress and it’s computed like: stress =v u u tP(dij −ˆ dij)2 Pd2 ij where ˆ dis the predicted disparities by the MDS, and dij is the distance in the original high dimensional space. Disparities are a transformation of the proximities that we deem admissible. Depending on how we compute these disparities we will be able to use the metric method or the non-metric method. This is useful because we can not always assume that the geometric distance is the one that is important to us. MDS could be useful for finding genetic distances between populations, and we can compute the dissimilarity of pairs of populations as we deem convenient. 6.6.1 Metric MDS Metric MDS tries to model the similarity of the data as distances between pairs of points. The distances are computed using the geometric coordinates of the data. When mapping the data from the high dimensional space to a lower dimensional space we try to preserve the distances between points as much as possible. Constructing the distance matrix of the data allows us to perform eigendecomposition or Singular Value Decomposition to compute the eigenvalues and eigenvectors to construct the lower dimensional space and embed the points in it. As we were trying to minimize the stress, the lower dimensional space found is fit to create a good representation of the data. 53 6.6.2 Non-Metric MDS In non-metric MDS, rather than using a distance metric for the distances between points in the embedding space, we use a non-parametric monotonic function. This means that only the order of dissimilarities is important rather than the amount of dissimilarities. This changes the optimization function to use the result of the function as the dissimilarity predicted by the MDS. Non-metric models represent only the ordinal properties of the data We can see that this procedure is very similar of what we have seen in PCA, and indeed classical MDS using euclidean distances is identical to PCA [24]. The difference is subtle then, it depends on how we choose the distance. We can find the lower dimensional space of non-linearly related data by optimizing the stress formula, which as we said is determined by our way of describing disparities, and so, we can find a way of measuring distances that is not necessarily linear. Also, PCA assumes linearity in the data. MDS does not need to make any assumption of that kind, and so is very suitable for a wide variety of data. PCA also has the restriction that uses the covariance or correlation as a measure for similarity, while in MDS we are able to choose any measure that suits us. Although MDS suffers from inconveniences. It is a numerical optimization technique, and as such it can fail to find the best solution possible because it gets stuck in a local minimum. There are some ways to overcome this issue, which involves initializing the method randomly some amount of times in order to prevent it to get stuck in the same place every time while optimizing the function. 54 7 Visualization Now that we have seen the methods we can see how are the visualizations in our web application. All the visualizations that we see have some degree of interaction in the web application, hovering over points allow us to see the exact coordinates of said point and we can also see the index of that point. In the case of 3 dimensional plots it is also possible to rotate the plot in order to see from all the angles. This kind of interactivity is removed here so we will try to include graphics which are representative enough. 7.1 MNIST dataset We have first chosen the MNIST dataset[7], which consists of handwritten digits. The dataset is labeled, and every variable corresponds to a pixel of a 28×28 image, which means we end up with 784 variables for each row. For each row we have the digit labeled. This dataset is very famous and widely used, and that is in part why who chose it, and even knowing that is considered a simple dataset we think it is a good dataset to show dimensionality reduction, because we will be going from 784 dimensions to 2 or 3. We will be using only a part of the dataset, because the original data is over 60.000 rows and the operations become quite time consuming when we are trying to process and render so many points. We are aware that choosing to use only a part of the dataset we probably end up with worse results, but it will give a nice idea of how the methods perform. We are going to start by plotting the result of the PCA. In Figure 4 we see that each class or digit is painted in a different colour, which allows us to visually see which classes the PCA has been able to separate better. It seems obvious that for most of the classes it did not do a great job, but we can see how it seems that it recognizes the digit 1. It also seems to group some other classes together, like classes 7 and 9 are in the same region in the plot. At the axis of the plot we find the explained variance of the Principal Component. In total, a 17.5% of the total variance is explained, which is not much, and that’s the reason it does not seem to perform well. 55 Figure 4: PCA result of the MNIST dataset in 2 dimensions In Figure 5 we have the plot for the LDA on the MNIST dataset. Now we can clearly see how the classes have been separated better than they did with PCA. The digit 1, which was the only one that really stood out in PCA is much more clearly separated from the rest. We also wee that digits 0 and 2 are quite separated in comparison with PCA, but that’s somehow expected given that we are explaining more than 40% of the variance. 56 reasons as before. With PCA in Figure 11 we can see that it does a relatively good job at separating the land-use type classes. The classes in the right side are almost entirely separated from one another, but the classes for corn and alfalfa are overlapping a lot. We could say that PCA performs better in this dataset, this is obvious when looking at the plots, but also, with the Indian Pines dataset the PCA is able to explain more than 80% of the total variance, so we know we have a good representation of the data. Figure 11: PCA result of the Indian Pine dataset in 2 dimensions LDA performed very good with the last dataset in Figure 12, and with this one we can see that it has separated all of the classes almost perfectly, with very little overlap with the classes Oats and Hay. LDA is very good at forming clusters because of how it works, pulling elements from the same 63 class together and separating different classes. This time LDA has explained more than 75% of the variance. Figure 12: LDA result of the Indian Pine dataset in 2 dimensions This time with Kernel PCA we tried to use the polynomial kernel with degree 3 to see how it would perform. The result is in Figure 13 Like in the previous dataset, PCA and Kernel PCA separate the classes in a similar manner. We can see that the same classes that PCA was struggling to separate, Kernel PCA does not separate either. Comparing the performance 64 with these two datasets for the methods, PCA and Kernel PCA did not perform as well as some others. This may be due the datasets not being the best for (Kernel)PCA. Figure 13: Kernel PCA result of the Indian Pine dataset in 2 dimensions In Figure 14 we see the result of t-SNE. Again, it has separated the classes almost perfectly, we can see how there is no overlap in most of the clusters and close to none overlap in some of them. We could say this is a good representation of how the data looks like given the low value for the 65 KL-divergence which t-SNE tries to minimize. Figure 14: t-SNE result of the Indian Pine dataset in 2 dimensions In Figure 15 we can see how MDS has improved the separation of the classes significantly with this dataset. It separates most of the classes like PCA or Kernel PCA does, but the ones they were struggling to separate, MDS achieved quite better. While there is still a bit overlapping between the classes, we can easily see the separation between the classes. 66 Figure 15: MDS result of the Indian Pine dataset in 2 dimensions 7.3 Categorical Variables with MCA To try MCA we’ve looked for categorical datasets to visualize. We are going to visualize the Mushroom dataset[8] and the Soybeans dataset[9]. First we are going to see the Mushroom dataset. It contains information from about 1300 mushrooms in 22 variables that have to help us decide if a given 67 mushroom is edible or poisonous. In Figure 16 we have plotted the result in 3 dimensions in order to maximize the amount of separation that we are able to see. We are able to determine that some of the clusters that MCA has created are very separated, and each of this clusters is probably a different mushroom species, and at the bottom we can see how the two classes overlap by a bit. We can deduce that some mushrooms that were analysed were fairly similar in terms of the attributes but correspond to different classes. 68 Figure 16: MCA result of the Mushroom dataset in 3 dimensions The second dataset is about diagnosing soybeans. It contains 35 variables from which we could extract which disease a given soybean has and it contains a relatively low sample size, 307. At first glance we can see that MCA did not perform well separating the classes in this particular dataset, most of the samples are grouped in the same space, overlapping massively 69 Figure 17: MCA result of the Soybeans dataset in 2 dimensions 70 8 Conclusions In this work we’ve presented the problem of visualizing complex data, and presented a few solutions to one of the properties of complex data, high dimensionality. To overcome the Curse of Dimensionality we’ve seen how six different dimensionality reduction methods work, including linear and non-linear methods that allow us to transform our original data matrix into a lower dimensional matrix that keeps most of the important information needed. Each method has it’s own way of dealing with this and as we’ve also seen, each of them produces very different visualizations when applied on the same dataset. We’ve created this web application because we have not found any other similar tool that allows a user to visualize easily complex data. It serves a need that is not otherwise met by any other tool. This is, however, the very first step to being able to visualize truly complex data, as high dimensionality is only one of the dimensions of the complexity of data. More work is needed if we want to be able to visualize any arbitrary dataset in any way. For example more work should be done with the different data types given that in this work we’ve only seen numerical and categorical variables, but the real world data is not always like this. Even in the field of dimensionality reduction more work can be done, as we’ve only explored a small part of all the methods that exist for that purpose. Even so, this work is meant as an introduction, a first step towards the visualization of truly complex data. A User Manual In this appendix we’re going to write a short user manual of the web application so any person reading this work can use it. The project is Dockerized so it can be ran in any system without compatibility problems. A container with all the necessary packages is created and the web application can be open in any modern web browser. Once we’ve opened it, the first interesting thing to do is to upload a dataset. In Figure 18 we have an example of how that will go. We first need to upload the dataset and then choose the options for it. It needs a bit of user inputs because there is information about the dataset that cannot be extracted automatically. We first need to tell the program if the dataset 71 contains mixed data types or if it’s all numerical or categorical. In case that we have a mixed dataset we will need to indicate all the categorical columns in the Input text box. We can write them in the form of intervals or individual numbers or both, separated by commas. Then we shall choose if we want to convert the categorical to numerical or the numerical to categorical. We recommend the former given that most of the methods used work with numerical values. After that we choose if the dataset uploaded is labeled or not, and if it is, we need to indicate the variable that contains the labels. Finally, if our dataset has missing values, we can choose what to do with them. The options are to delete them or to impute them. The method for imputing is discussed in section 4.1. Figure 18: Upload view of the web application After uploading the dataset, we can jump directly to visualize the data by choosing the desired method in the sidebar we see in Figure 19. The methods are the same we’ve seen in section 6. Aside from those options we have a view to see the dataset in table form in case that’s convenient for anyone. The user can also choose the Visualization option if they want to 72