A device, method and application for visualizing matrices
By using a recursive binary search method to map the row vectors of a high-dimensional 0-1 matrix to a two-dimensional plane and generate a scatter plot, the problem of difficulty in observing the data distribution of a high-dimensional matrix on a single screen is solved, achieving clear visualization and data relationship analysis.
Patent Information
- Application Number
- CN202210704332.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-21
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-06-21
AI Technical Summary
When visualizing an M-row N-column 0-1 matrix on a two-dimensional plane, existing technologies make it difficult to effectively observe the distribution characteristics of the data, especially for high-dimensional 0-1 matrices, where it is difficult to observe the distribution characteristics of the data on a single screen.
The recursive bisection method is used to classify the row vectors of the matrix and map them to the corresponding regions on the two-dimensional plane to generate a scatter plot. The N-dimensional row vectors are then mapped to points (x,y) on the two-dimensional plane through the recursive bisection method, thus realizing the visualization of the matrix.
It enables a clear display of the data distribution characteristics of a high-dimensional 0-1 matrix on a single screen, allowing for an overall observation of the relationships between data, identification of outliers, and providing an effective visualization analysis method.
Smart Images

Figure CN115269736B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data visualization, in particular to a visualization device, method and application for a matrix. BACKGROUND
[0002] With the development of digital economy, it is feasible and popular to complete tens, hundreds, thousands or even hundreds of millions of case investigations in the form of page forms, shared forms and the like based on the Internet.
[0003] As shown in Table 1, a row is a case; a column is an answer (yes / no) to a survey question.
[0004] Table 1:
[0005] 1 yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes 2 yes yes yes yes yes yes yes yes yes no yes yes yes yes yes 3 yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes 4 yes yes yes yes yes yes yes yes yes no yes yes no yes no 5 yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes 6 yes yes yes yes yes yes yes yes yes yes yes yes no yes yes 7 yes yes yes yes yes yes yes yes yes yes yes yes no yes yes 8 yes yes yes yes yes yes yes yes yes yes yes yes no yes yes 9 no yes yes yes yes yes yes yes yes yes yes yes no yes yes 10 yes yes yes yes no yes yes no yes yes yes yes yes yes yes 11 yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes 12 yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes 13 yes yes yes yes no yes yes yes yes no yes yes yes yes yes 14 yes yes yes no yes yes yes yes yes yes yes yes no yes no 15 yes yes yes yes yes yes yes yes yes no yes yes yes yes no 16 yes yes yes yes yes yes yes no yes no yes yes yes yes no 17 yes yes yes yes yes yes yes yes yes yes yes yes no yes no 18 yes yes yes yes yes yes yes yes yes yes yes yes yes yes no 19 yes yes yes yes yes yes yes yes yes no yes yes yes yes yes 20 yes yes yes yes no yes yes yes yes yes yes yes no yes yes 21 yes no yes yes yes yes yes yes yes no yes yes yes yes no 22 yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes 23 yes yes yes yes yes yes yes no yes no yes yes yes yes yes 24 yes yes yes yes no yes yes no yes yes yes yes no yes yes 25 yes yes yes yes yes yes yes yes yes yes yes yes no yes yes 26 yes yes yes yes yes no yes yes yes yes yes yes yes yes no 27 yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes 28 yes yes yes yes yes no yes yes yes yes yes yes yes yes no 29 yes yes yes yes no yes yes yes yes no yes yes no yes no 30 yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes 31 yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes 32 no yes yes yes no yes yes yes yes no yes yes no yes no
[0006] Such a survey result forms a 01 matrix: 0 represents “no”; 1 represents “yes”.
[0007] The investigator hopes to visualize the overall distribution of the cases. For a survey result represented by a matrix of M rows and N columns, when N is greater than 7, only multiple screens can be used for display, and it is impossible to display on one screen, so it is impossible to conveniently and effectively observe the distribution of data and the relationship between data.
[0008] A method and application for visualizing hierarchical data with multi-dimensional attributes are disclosed in CN 105404643 B. The MCT method selects a set of four-dimensional attribute data associated with each other in the hierarchical relationship as the data set to be displayed, combines parallel coordinates with tree graph layout rectangular filling method, uses cardinal spline curve for attribute connection, optimizes straight lines into curves with intermediate shrinkage, and thus displays the data hierarchy and multi-dimensional attribute information in the limited visualization space. The MCT is applied to the agricultural residue data, and the pesticide residue detection complex data with hierarchy, multi-dimension and space-time characteristics are displayed. The tree graph is used to represent the hierarchy of agricultural product classification, pesticide classification and region, and the multi-dimensional coordinates in the rectangular node are used to represent the multi-dimensional attributes such as agricultural product, pesticide, residue amount and limit standard value, and good visualization analysis effect is achieved.
[0009] CN 108073695 B, entitled "High-dimensional time-varying data visualization method with reduced dimension space visual perception enhancement". The high-dimensional time-varying data is read, and a two-dimensional spatial coordinate of the high-dimensional time-varying data is obtained using a multidimensional scaling algorithm. The coordinates of the high-dimensional time-varying data in the two-dimensional space are solved to obtain a target orthogonal matrix. The projection of the high-dimensional time-varying data in the two-dimensional space is minimized using the target orthogonal matrix to obtain the projection of the high-dimensional time-varying data at the current time. The visualization and analysis efficiency of the high-dimensional time-varying data can be significantly improved.
[0010] In combination with the above two patent documents and the existing technical solutions, the inventors have found that the existing technical solutions have the following technical problems.
[0011] A 01 matrix of M rows and N columns can be visualized on a two-dimensional plane. In the 01 matrix, 0 and 1 are essentially nominal data, and only serve as labels without numerical values. Therefore, it is not feasible to reveal the relationship between data by distance-based calculations based on size. In the past, visualization could only be achieved through bitmaps: the row number and column number were mapped to two coordinate axes of a plane coordinate system, and a visual attribute (such as color) was used to display the data, for example, white was used to display 0 and black was used to display 1. However, it is difficult to observe the distribution characteristics of the data using this bitmap method, especially for high-dimensional 01 matrices, it is difficult to observe the distribution characteristics of the data on one screen.
[0012] Existing technical problems and considerations:
[0013] How to solve the technical problem of poor matrix visualization effect. SUMMARY
[0014] The technical problem to be solved by the present application is to provide a visualization device, method and application for a matrix, which solves the technical problem of poor matrix visualization effect.
[0015] To solve the above technical problems, the technical solution adopted by the present application is: a visualization device for a matrix includes a conversion module, which is a program module, for obtaining a matrix, the matrix being a 01 matrix, the matrix being composed of row vectors, and the matrix being classified and mapped to the corresponding area on a two-dimensional plane by recursive bisection to obtain a scatter plot.
[0016] Further technical solutions are as follows: the conversion module is further used for the matrix being a matrix of M rows and N columns, the row vector of the matrix being an N-dimensional row vector, and the N-dimensional row vector being mapped to a point (x, y) on a two-dimensional plane based on recursive bisection, wherein x is the horizontal coordinate and y is the vertical coordinate; the row vector is classified by recursive bisection to obtain M points (x, y), and each point is displayed on the two-dimensional plane.
[0017] The further technical scheme is characterized in that the conversion module is further used for obtaining a two-dimensional plane including a horizontal axis and a vertical axis, and a point (x, y) of the two-dimensional plane, wherein x is a horizontal coordinate of the horizontal axis, 0≤x
[0018] The further technical scheme is characterized in that the conversion module is further used for obtaining a two-dimensional plane including a horizontal axis and a vertical axis, and a point (x, y) of the two-dimensional plane, wherein x is a horizontal coordinate of the horizontal axis, 0≤x
[0019] The further technical scheme is characterized in that the conversion module is further used for obtaining a two-dimensional plane including a horizontal axis and a vertical axis, and a point (x, y) of the two-dimensional plane, wherein x is a horizontal coordinate of the horizontal axis, 0≤x
[0020] A method for visualizing a matrix includes a conversion step of obtaining a matrix, the matrix being a 01 matrix, the matrix being composed of row vectors, classifying and mapping the row vectors to corresponding regions on a two-dimensional plane by using a recursive bisection method, and obtaining a scatter plot.
[0021] Further technical solutions are as follows: in the conversion step, the two-dimensional plane includes a horizontal axis and a vertical axis, and a point (x, y) of the two-dimensional plane, where x is a horizontal coordinate of the horizontal axis, 0≤xN, y is a vertical coordinate of the vertical axis, 0≤yN; the step of classifying and mapping the row vector includes obtaining odd bit data in the row vector and forming an odd bit vector, obtaining even bit data in the row vector and forming an even bit vector, the dimension of the row vector is N as the maximum scale of the horizontal coordinate of the horizontal axis and the vertical coordinate of the vertical axis, the x value of the point of the odd bit vector on the horizontal axis of 0-N is obtained based on the recursive bisection method, and the y value of the point of the even bit vector on the vertical axis of 0-N is obtained based on the recursive bisection method; the step of obtaining the x value of the point of the odd bit vector on the horizontal axis based on the recursive bisection method includes obtaining first bit data of the odd bit vector, dividing x on one side of the middle line of the 0-N region of the horizontal axis, i.e. the first bisection region of the horizontal axis, according to the first bit data of the odd bit vector, obtaining second bit data of the odd bit vector, and dividing x on one side of the middle line of the first bisection region of the horizontal axis, i.e. the second bisection region of the horizontal axis, according to the second bit data of the odd bit vector, and so on until the last bit data of the odd bit vector is obtained, x is divided on one side of the middle line of the previous bisection region of the horizontal axis, i.e. the obtained classification region of the horizontal axis, according to the last bit data of the odd bit vector, and x is randomly taken in the classification region of the horizontal axis; the step of obtaining the y value of the point of the even bit vector on the vertical axis based on the recursive bisection method includes obtaining first bit data of the even bit vector, dividing y on one side of the middle line of the 0-N region of the vertical axis, i.e. the first bisection region of the vertical axis, according to the first bit data of the even bit vector, obtaining second bit data of the even bit vector, and dividing y on one side of the middle line of the first bisection region of the vertical axis, i.e. the second bisection region of the vertical axis, according to the second bit data of the even bit vector, and so on until the last bit data of the even bit vector is obtained, y is divided on one side of the middle line of the previous bisection region of the vertical axis, i.e. the obtained classification region of the vertical axis, according to the last bit data of the even bit vector, and y is randomly taken in the classification region of the vertical axis.
[0022] A device for visualizing a matrix includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the corresponding steps when executing the computer program.
[0023] A device for visualizing a matrix includes a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the corresponding steps.
[0024] An application for visualizing a matrix, and the use of the recursive bisection method in 01 matrix visualization.
[0025] The beneficial effects of the above technical solutions are as follows:
[0026] The application discloses a device for visualizing a matrix, which comprises a conversion module, which is a program module, and is used for obtaining a matrix, wherein the matrix is a 01 matrix, the matrix is composed of row vectors, and the matrix is classified by using a recursive bisection method, is mapped to a corresponding region on a two-dimensional plane, and a scatter plot is obtained.
[0027] The application discloses a method for visualizing a matrix, which comprises a conversion step, obtaining a matrix, wherein the matrix is a 01 matrix, the matrix is composed of row vectors, and the matrix is classified by using a recursive bisection method, is mapped to a corresponding region on a two-dimensional plane, and a scatter plot is obtained.
[0028] The application discloses an application for visualizing a matrix, and a use of a recursive bisection method in 01 matrix visualization, and the method is good in visualizing a matrix.
[0029] For details, refer to the part of the specific embodiment. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 is a principle block diagram of embodiment 1 of the application;
[0031] Figure 2 is a first screenshot of the application;
[0032] Figure 3 is a second screenshot of the application;
[0033] Figure 4 is a third screenshot of the application;
[0034] Figure 5 is a fourth screenshot of the application;
[0035] Figure 6 is a fifth screenshot of the application;
[0036] Figure 7 is a sixth screenshot of the application;
[0037] Figure 8 is a seventh screenshot of the application;
[0038] Figure 9 is an eighth screenshot of the application;
[0039] Figure 10 is a ninth screenshot of the application;
[0040] Figure 11 is a tenth screenshot of the application;
[0041] Figure 12 is a scatter plot of the application. DETAILED DESCRIPTION
[0042] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. The description of the at least one example embodiment is actually only illustrative, but not as any limitation on the present application and its application or use. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0043] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, but the present application can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without departing from the content of the present application, therefore the present application is not limited to the specific embodiments disclosed below.
[0044] Embodiment 1:
[0045] As shown in the Figure 1 application discloses a visualization device for a matrix, which comprises a conversion module, and the conversion module is a program module.
[0046] The conversion module is used to obtain a matrix, the matrix is a 01 matrix, the matrix is composed of row vectors, and the matrix is classified and mapped to a corresponding region on a two-dimensional plane by using a recursive bisection method, and a scatter plot is obtained.
[0047] The matrix is an M-row-by-N-column matrix, the row vector of the matrix is an N-dimensional row vector, the two-dimensional plane comprises a horizontal axis and a vertical axis, and the point (x, y) of the two-dimensional plane, wherein x is the horizontal coordinate of the horizontal axis, 0≤x
[0048] The step of classifying and mapping the row vector comprises obtaining odd bit data in the row vector and forming an odd bit vector, obtaining even bit data in the row vector and forming an even bit vector, the dimension of the row vector is N as the maximum scale of the horizontal coordinate of the horizontal axis and the vertical coordinate of the vertical axis, the x value of the point of the odd bit vector on the horizontal axis of 0-N is obtained based on the recursive bisection method, and the y value of the point of the even bit vector on the vertical axis of 0-N is obtained based on the recursive bisection method.
[0049] The step of obtaining the x value of the point of the odd bit vector on the horizontal axis based on the recursive dichotomy includes obtaining the first bit data of the odd bit vector, dividing x on one side of the middle line of the 0-N region of the horizontal axis, i.e., the first dichotomy region of the horizontal axis, according to the first bit data of the odd bit vector, when the first bit data is 1, dividing x on the right side of the middle line of the 0-N region of the horizontal axis, when the first bit data is 0, dividing x on the left side of the middle line of the 0-N region of the horizontal axis; obtaining the second bit data of the odd bit vector, dividing x on one side of the middle line of the first dichotomy region of the horizontal axis, i.e., the second dichotomy region of the horizontal axis, according to the second bit data of the odd bit vector, when the second bit data is 1, dividing x on the right side of the middle line of the first dichotomy region of the horizontal axis, when the second bit data is 0, dividing x on the left side of the middle line of the first dichotomy region of the horizontal axis; until the last bit data of the odd bit vector is obtained, dividing x on one side of the middle line of the previous dichotomy region of the horizontal axis, i.e., the classification region of the horizontal axis, according to the last bit data of the odd bit vector, and randomly taking x in the classification region of the horizontal axis, when the last bit data is 1, dividing x on the right side of the middle line of the previous dichotomy region of the horizontal axis, when the last bit data is 0, dividing x on the left side of the middle line of the previous dichotomy region of the horizontal axis;
[0050] The step of obtaining the y value of the point of the even bit vector on the vertical axis based on the recursive dichotomy includes obtaining the first bit data of the even bit vector, dividing y on one side of the middle line of the 0-N region of the vertical axis, i.e., the first dichotomy region of the vertical axis, according to the first bit data of the even bit vector, when the first bit data is 1, dividing y on the upper side of the middle line of the 0-N region of the vertical axis, when the first bit data is 0, dividing y on the lower side of the middle line of the 0-N region of the vertical axis; obtaining the second bit data of the even bit vector, dividing y on one side of the middle line of the first dichotomy region of the vertical axis, i.e., the second dichotomy region of the vertical axis, according to the second bit data of the even bit vector, when the second bit data is 1, dividing y on the upper side of the middle line of the first dichotomy region of the vertical axis, when the second bit data is 0, dividing y on the lower side of the middle line of the first dichotomy region of the vertical axis; until the last bit data of the even bit vector is obtained, dividing y on one side of the middle line of the previous dichotomy region of the vertical axis, i.e., the classification region of the vertical axis, according to the last bit data of the even bit vector, and randomly taking y in the classification region of the vertical axis, when the last bit data is 1, dividing y on the upper side of the middle line of the previous dichotomy region of the vertical axis, when the last bit data is 0, dividing y on the lower side of the middle line of the previous dichotomy region of the vertical axis;
[0051] M points (x, y) are obtained by classifying the row vector through the recursive dichotomy, and each point is displayed on a two-dimensional plane.
[0052] Embodiment 2:
[0053] The application discloses a kind of visualization method for matrix, including conversion step, as follows specifically:
[0054] obtaining a matrix, the matrix being a 01 matrix, the matrix being composed of row vectors, classifying and mapping the row vectors to corresponding regions on a two-dimensional plane by recursive dichotomy and obtaining a scatter plot.
[0055] In the converting step, the matrix is a matrix of M rows and N columns, the row vector of the matrix is an N-dimensional row vector, the two-dimensional plane includes an abscissa axis and an ordinate axis, and a point (x, y) of the two-dimensional plane, where x is an abscissa axis abscissa coordinate, 0≤x
[0056] In the converting step, the step of classifying and mapping the row vector includes obtaining odd bit data in the row vector and forming an odd bit vector, obtaining even bit data in the row vector and forming an even bit vector, the dimension of the row vector is N as the maximum scale of the abscissa axis abscissa coordinate and the ordinate axis ordinate coordinate, obtaining the x value of the point of the odd bit vector on the abscissa axis of 0-N based on recursive dichotomy, and obtaining the y value of the point of the even bit vector on the ordinate axis of 0-N based on recursive dichotomy.
[0057] The step of obtaining the x value of the point of the odd bit vector on the abscissa axis based on recursive dichotomy includes obtaining first bit data of the odd bit vector, dividing x on one side of the middle line of the 0-N region of the abscissa axis, i.e., the first dichotomy region of the abscissa axis, according to the first bit data of the odd bit vector, when the first bit data is 1, dividing x on the right side of the middle line of the 0-N region of the abscissa axis, when the first bit data is 0, dividing x on the left side of the middle line of the 0-N region of the abscissa axis; obtaining second bit data of the odd bit vector, dividing x on one side of the middle line of the first dichotomy region of the abscissa axis, i.e., the second dichotomy region of the abscissa axis, according to the second bit data of the odd bit vector, when the second bit data is 1, dividing x on the right side of the middle line of the first dichotomy region of the abscissa axis, when the second bit data is 0, dividing x on the left side of the middle line of the first dichotomy region of the abscissa axis; until the last bit data of the odd bit vector is obtained, dividing x on one side of the middle line of the previous dichotomy region of the abscissa axis, i.e., the obtained classification region of the abscissa axis, according to the last bit data of the odd bit vector, when the last bit data is 1, dividing x on the right side of the middle line of the previous dichotomy region of the abscissa axis, when the last bit data is 0, dividing x on the left side of the middle line of the previous dichotomy region of the abscissa axis.
[0058] The step of obtaining the y value of the point on the vertical axis of the even-bit vector based on the recursive dichotomy comprises: obtaining the first bit data of the even-bit vector, dividing y on one side of the middle line of the 0-N region of the vertical axis, i.e., the first dichotomy region of the vertical axis, according to the first bit data of the even-bit vector, dividing y on the upper side of the middle line of the 0-N region of the vertical axis when the first bit data is 1, and dividing y on the lower side of the middle line of the 0-N region of the vertical axis when the first bit data is 0; obtaining the second bit data of the even-bit vector, dividing y on one side of the middle line of the first dichotomy region of the vertical axis, i.e., the second dichotomy region of the vertical axis, according to the second bit data of the even-bit vector, dividing y on the upper side of the middle line of the first dichotomy region of the vertical axis when the second bit data is 1, and dividing y on the lower side of the middle line of the first dichotomy region of the vertical axis when the second bit data is 0; and obtaining the last bit data of the even-bit vector, dividing y on one side of the middle line of the previous dichotomy region of the vertical axis, i.e., the obtained classification region of the vertical axis, according to the last bit data of the even-bit vector, and randomly taking y in the classification region of the vertical axis, dividing y on the upper side of the middle line of the previous dichotomy region of the vertical axis when the last bit data is 1, and dividing y on the lower side of the middle line of the previous dichotomy region of the vertical axis when the last bit data is 0.
[0059] In the conversion step, M points (x, y) are obtained by classifying the row vector through the recursive dichotomy, and each point is displayed on a two-dimensional plane.
[0060] Embodiment 3:
[0061] The application discloses a device for visualizing a matrix, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of embodiment 2 when executing the computer program.
[0062] Embodiment 4:
[0063] The application discloses a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program implements the steps in embodiment 2 when executed by a processor.
[0064] In the step of dividing x on one side of the middle line of the 0-N region of the horizontal axis, i.e., the first dichotomy region of the horizontal axis, according to the first bit data of the odd-bit vector, 0 can be defined in the right side region and 1 can be defined in the left side region, relative to the above embodiment.
[0065] In the step of dividing y on one side of the middle line of the 0-N region of the vertical axis, i.e., the first dichotomy region of the vertical axis, according to the first bit data of the even-bit vector, 0 can be defined in the upper side region and 1 can be defined in the lower side region, relative to the above embodiment.
[0066] The concept of the application:
[0067] In the spatial data research, the geographical position represented by longitude and latitude can be converted into a binary represented integer by a GeoHash encoding. The earth latitude interval is [-90, 90], and the longitude interval is [-180, 180]. The encoding first divides the space into four blocks, i.e. cutting into four blocks according to "latitude 0, longitude 0". According to the zigzag order, the left lower corner is encoded as 00, the left upper corner is encoded as 01, the right lower corner is encoded as 10, and the right upper corner is encoded as 11. Then each block is recursively divided into smaller sub-blocks, and each sub-block is continuously encoded according to the zigzag order, and a binary integer consisting of only 0 and 1 is formed.
[0068] The mapping from longitude and latitude to the binary integer is reversible. A row vector of a 01 matrix can be regarded as a binary integer, and the row vector can be mapped to a two-dimensional plane by inverse transformation of the GeoHash encoding. The dimension of the row vector is used as the maximum scale of the horizontal and vertical coordinates of the plane.
[0069] Technical contributions of the present application:
[0070] In view of the problem that a high-dimensional 01 matrix is difficult to observe the relationship between data as a whole, a recursive binary method for visualizing a 01 matrix is disclosed. For a 01 matrix of M rows and N columns, when N is less than or equal to 7, a column chart is usually used to visualize the frequency of 0 or 1; and when N is greater than 7, due to the limitation of the two-dimensional space of the screen, multiple screens are used, and the relationship between data cannot be observed as a whole. Since the row vector in the 01 matrix of M rows and N columns is an N-dimensional vector with the classification variable label 0 or 1 as an element, the recursive binary method is used to map the N-dimensional row vector to two coordinate axes X and Y of a plane, so that the relationship between data can be observed through the position of the row vector in the plane. The recursive binary method maps the row vector to a point (x, y) in the two-dimensional plane coordinate system, where 0≤x
[0071] The algorithm is explained as follows:
[0072]
[0073]
[0074] The x value and the y value of each row vector are a point (x, y) of the row vector in the plane. Finally, the corresponding x value and y value are displayed in the plane coordinate system using a scatter plot.
[0075] No matter how large M or N is, the present technology can realize the use of one screen to display and solve the problem of displaying the distribution of a high-dimensional 01 matrix using one screen.
[0076] For example, assuming that N=9, the recursive binary method can visualize a 01 matrix of 3 rows and 9 columns:
[0077]
[0078] This 01 matrix has three row vectors: (1,1,1,1,1,1,1,0,1), (1,1,1,1,1,1,1,1,1), and (1,1,1,1,1,1,1,1,0). The odd bits of the first row vector are 11111; the even bits are 1110.
[0079] As shown in FIG. 1 1, the odd bits 1111 are first mapped to some position P on the X axis. Since the first odd bit is 1, P is in the right half of the vertical line x = (0+9) ÷ 2 = 4.5. Figure 2 As shown in FIG. 12, the right half is bisected, and since the second odd bit is 1, P is in the right half of the vertical line x = (4.5+9) ÷ 2 = 6.75.
[0080] Figure 3 As shown in FIG. 13, the right half is bisected, and since the third odd bit is 1, P is in the right half of the vertical line x = (6.75+9) ÷ 2 = 7.875.
[0081] As shown in FIG. 14, the right half is bisected, and since the fourth odd bit is 1, P is in the right half of the vertical line x = (7.875+9) ÷ 2 = 8.4375. Figure 4 As shown in FIG. 15, the right half is bisected, and since the fifth odd bit is 1, P is in the right half of the vertical line x = (8.4375+9) ÷ 2 = 8.71875. A random point in the right half of the line x = 1 is chosen as the value of P, such as P = 8.75.
[0082] Figure 5 The even bits 1110 are then mapped to some position Q on the Y axis.
[0083] As shown in FIG. 16, since the first odd bit is 1, Q is in the upper half of the horizontal line y = (0+9) ÷ 2 = 4.5. Figure 6 As shown in FIG. 17, the upper half is bisected, and since the second odd bit is 1, Q is in the upper half of the vertical line y = (4.5+9) ÷ 2 = 6.75.
[0084] As shown in FIG. 18, the upper half is bisected, and since the third odd bit is 1, Q is in the upper half of the vertical line y = (6.75+9) ÷ 2 = 7.875.
[0085] Figure 7 As shown in FIG. 19, the upper half is bisected, and since the fourth odd bit is 1, Q is in the upper half of the vertical line y = (7.875+9) ÷ 2 = 8.4375.
[0086] As shown in FIG. 20, the upper half is bisected, and since the fifth odd bit is 1, Q is in the upper half of the vertical line y = (8.4375+9) ÷ 2 = 8.71875. A random point in the upper half of the line y = 1 is chosen as the value of Q, such as Q = 8.75. Figure 8
[0087] Figure 9
[0088] As shown in Figure 10
[0089] Randomly select a point in the lower side of the straight line y=8.4375 as the value of Q, such as P=8.12.
[0090] Then, (P,Q)=(8.96,8.12) is the position of the first row vector in the plane.
[0091] As shown in Figure 11
[0092] Technical solution:
[0093] A specific data example is shown as follows:
[0094] As shown in Table 2, a university wants to know whether the students are familiar with 283 English words such as “abstract, acquire, act” or not. 209 subjects are selected to select “yes” or “no” for each word: “yes” means familiar; “no” means unfamiliar. The results are summarized to form a 209-row EXCEL file.
[0095] Table 2: Part of the data table obtained
[0096] No abstract acquire act adapt administer advertise analysis anticipate apply appraise argue arrange articulate ask 1 1001 yes yes yes yes yes yes yes yes yes yes yes yes yes yes 2 1002 yes yes yes yes yes yes yes yes yes no yes yes yes yes 3 1003 yes yes yes yes yes yes yes yes yes no yes yes yes yes 4 1004 yes yes yes yes yes yes yes yes yes no yes yes no yes 5 1005 yes yes yes yes yes yes yes yes yes yes yes yes yes yes 6 1006 yes yes yes yes yes yes yes yes yes yes yes yes no yes 7 1007 yes yes yes yes yes yes yes yes yes yes yes yes no yes 8 1008 yes yes yes yes yes yes yes yes yes yes yes yes no yes 9 1009 no yes yes yes yes yes yes yes yes yes yes yes no yes 10 1010 yes yes yes yes no yes yes no yes yes yes yes yes yes 11 1011 yes yes yes yes no yes yes yes yes no yes yes yes yes 12 1012 yes yes yes yes yes yes yes yes yes yes yes yes yes yes 13 1013 yes yes yes yes no yes yes yes yes no yes yes yes yes 14 1014 yes yes yes no yes yes yes yes yes yes yes yes no yes 15 1015 yes yes yes yes yes yes yes yes yes no yes yes no yes 16 1016 yes yes yes yes no yes yes no yes no yes yes yes yes 17 1017 yes no yes yes no yes yes yes yes no yes yes no yes 18 1018 yes yes yes yes yes yes yes yes yes yes yes yes no yes 19 1019 yes yes yes yes yes yes yes yes yes no yes yes yes yes 20 1020 yes yes yes yes no yes yes yes yes yes yes yes no yes 21 1021 yes no yes yes yes yes yes yes yes no yes yes yes yes 22 1022 yes yes yes yes yes yes yes yes yes yes yes yes yes yes 23 1023 yes yes yes yes yes yes yes no yes no yes yes yes yes 24 1024 yes yes yes yes no yes yes no yes yes yes yes no yes 25 1025 yes yes yes yes yes yes yes yes yes yes yes yes no yes 26 1026 yes yes yes yes yes no yes yes yes yes yes yes yes yes 27 1027 yes yes yes yes yes yes Yes Yes Yes Yes Yes Yes Yes Yes 28 1028 Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes 29 1029 Yes Yes Yes Yes No Yes Yes Yes No Yes Yes No Yes Yes 30 1030 Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes 31 1031 Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes No Yes Yes 32 1032 Yes No Figure 12
[0097] In R (https: / / www.r-project.org / , a popular statistical software), a script can be designed to achieve the following steps:
[0098] Step 1: Import. Assuming that the EXCEL data file is D: / a.xlsx, first use the xlsx package to import
[0099] install.packages(″xlsx″)
[0100] library(xlsx)
[0101] Data<-read.xlsx2(file=″D: / a.xlsx″,sheetlndex=1)
[0102] Step 2: Factorization. The imported data file is called “data frame” in R, and each column in the data frame is set to a factor type.
[0103] AllData<-Data
[0104] AllData[sapply(AllData, is.character)]<-lapply(AllData[sapply(AllData, is.character)],as.factor)
[0105] Step 3: Replace factor levels. R's default level encoding starts from 1, so you need to replace 1 with 0 and 2 with 1.
[0106]
[0107] Step 4: Transform into a matrix. Convert the factor data frame into a matrix.
[0108] AllData<-apply(AllData,2,as.numeric)
[0109] ALLData<-AllData[,-1]
[0110] B <- as.matrix(ALLData)
[0111] dim(B)
[0112] M<-209; N<-283;
[0113] Step 5: Transform the row vectors into planar coordinates.
[0114]
[0115]
[0116] Step 6: Use a scatter plot to display the results.
[0117] like As shown, the results are presented using a scatter plot.
[0118] plot(X,Y)
[0119] After this application was kept confidential for a period of time, the beneficial aspects reported by the on-site technical personnel were:
[0120] The distribution of the 01 matrix row vector is displayed on a screen, so that the user can observe the relationship (similar, related, etc.) between the data as a whole, and can also be applied to find outliers, and the results can be explained: similar row vectors are symmetric in position on the plane. Since the application of the 01 matrix is very common, the present application provides an effective method for visualizing and analyzing data represented by the 01 matrix. For example, a survey result set with N questions, each of which only answers "yes / no", can be regarded as a 01 matrix. The present application can enable the surveyor to observe the distribution of all respondents' responses on all N-dimensional variables using a two-dimensional scatter plot on a screen.
[0121] At present, the technical scheme of the present application has been pilot tested, that is, a small-scale test before mass production of the product; after the pilot test is completed, user use research is carried out in a small range, and the research results show that the user satisfaction is high; now the preparation for formal production of the product for industrialization (including intellectual property risk early warning research) has begun.
Claims
1. A visualization device for matrices, characterized in that: It includes a conversion module, which is a program module used to obtain a matrix. The matrix is a 0-1 matrix composed of row vectors. The matrix is classified and mapped to the corresponding regions on a two-dimensional plane by a recursive binary search method to obtain a scatter plot. The conversion module is also used for matrices with M rows and N columns, where the row vectors of the matrix are N-dimensional row vectors. Based on the recursive binary search method, the N-dimensional row vectors are mapped to points (x, y) on a two-dimensional plane, where x is the horizontal coordinate and y is the vertical coordinate. The row vectors are classified into M points (x, y) by the recursive binary search method, and each point is displayed on the two-dimensional plane. The conversion module is also used for a two-dimensional plane including the horizontal axis and the vertical axis, and a point (x, y) in the two-dimensional plane, where x is the horizontal coordinate of the horizontal axis, 0 ≤ x < N, and y is the vertical coordinate of the vertical axis, 0 ≤ y < N; the steps of row vector classification and mapping include obtaining the odd-numbered data in the row vector and forming an odd-numbered vector, obtaining the even-numbered data in the row vector and forming an even-numbered vector, with the dimension of the row vector being N as the maximum scale of the horizontal and vertical coordinates, obtaining the x-values of the odd-numbered vectors on the horizontal axis from 0 to N based on the recursive binary search method, and obtaining the y-values of the even-numbered vectors on the vertical axis from 0 to N based on the recursive binary search method; The conversion module is also used to obtain the x-value of the odd-numbered vector on the horizontal axis based on the recursive bisection method. This includes obtaining the first data of the odd-numbered vector, dividing x into one side of the middle region of the horizontal axis region 0 to N based on the first data of the odd-numbered vector, i.e., the first bisection region of the horizontal axis; obtaining the second data of the odd-numbered vector, dividing x into one side of the middle region of the first bisection region of the horizontal axis based on the second data of the odd-numbered vector, i.e., the second bisection region of the horizontal axis; and so on until the last data of the odd-numbered vector is obtained, dividing x into one side of the middle region of the first bisection region of the horizontal axis based on the last data of the odd-numbered vector, i.e., the obtained horizontal axis classification region, where x is randomly selected in the horizontal axis classification region.
2. The matrix visualization device according to claim 1, characterized in that: The conversion module is also used to obtain the y-value of the even-numbered vector on the vertical axis based on the recursive bisection method. This includes obtaining the first data of the even-numbered vector, dividing y into one side of the vertical axis region 0 to N based on the first data of the even-numbered vector, i.e., the first bisection region of the vertical axis; obtaining the second data of the even-numbered vector, dividing y into one side of the vertical axis region 1 based on the second data of the even-numbered vector, i.e., the second bisection region of the vertical axis; and so on until the last data of the even-numbered vector is obtained, dividing y into one side of the vertical axis region 1 of the first bisection region based on the last data of the even-numbered vector, i.e., the obtained vertical axis classification region, where y is randomly selected in the vertical axis classification region.
3. A method for visualizing matrices, based on the matrix visualization device according to claim 1, characterized in that: The process includes a transformation step to obtain a matrix, which is a 0-1 matrix composed of row vectors. The matrix is then classified and mapped to the corresponding regions on a two-dimensional plane using a recursive binary search method to obtain a scatter plot. In the transformation step, the two-dimensional plane includes the horizontal axis and the vertical axis, and the point (x, y) in the two-dimensional plane is defined by x. Let x be the x-axis coordinate, 0 ≤ x < N, and y be the y-axis coordinate, 0 ≤ y < N. The steps for classifying and mapping row vectors include obtaining the odd-numbered data points of the row vectors and forming odd-numbered vectors, obtaining the even-numbered data points of the row vectors and forming even-numbered vectors, with the dimension of the row vectors being N, serving as the maximum scale for both the x-axis and y-axis coordinates. The x-values of the odd-numbered vectors on the x-axis (0–N) are obtained using a recursive bisection method, and the y-values of the even-numbered vectors on the y-axis (0–N) are obtained using the same method. The steps for obtaining the x-values of the odd-numbered vectors on the x-axis using the recursive bisection method include obtaining the first data point of the odd-numbered vector, dividing x into one side of the midline of the x-axis region (0–N) based on the first data point (i.e., the first bisection region of the x-axis); obtaining the second data point of the odd-numbered vector, dividing x into one side of the midline of the first bisection region of the x-axis (i.e., the second bisection region of the x-axis). The process involves two subdivisions: First, the odd-numbered vector is divided into two regions. The first subdivision involves obtaining the first bit of the even-numbered vector. The second subdivision involves dividing the y-value of the even-numbered vector into two regions. The process continues until the last bit of the even-numbered vector is obtained. The y-value is then divided into two regions. The y-value is randomly selected within each region.
4. A visualization device for matrices, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the corresponding steps in claim 3.
5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, it implements the corresponding steps in claim 3.
Citation Information
Patent Citations
A method for visualizing high-dimensional time-varying data with reduced spatial visual perception
CN108073695B