Radius Networks Developer Portal

Latest Post 14 Aug 2018

Porting LDA to Go Lang

Eleanor Nuechterlein

One of the most fundamental uses of the customer location platform is the ability to deploy a network of wireless detectors that identify the location of a customer. When many table tents are deployed, however, it is sometimes difficult to visualize where exactly the tents are located because as more tents are added, more dimensions are created, which can make it difficult to visualize the data in two dimensions. A solution to this issue is the use of linear discriminant analysis (LDA), a method used to find a linear combination of features that separates classes of objects. In other words, LDA distributes the tents into groups of the same type (zones). LDA works when the measurements of each tent for each observation are continuous and when groups are known a priori.

I re-coded an LDA code from Java to Golang and also referenced an LDA code written in Python. The LDA code I wrote in Golang includes three functions. The first function performs a LDA on the matrix of input data where each row is an observation and each column is a variable. The code takes the training samples and number of classes as parameters and returns whether the analysis is successful. The second function performs a transformation on the matrix of input data and returns the transformed matrix. The third function performs a prediction to assess which zone a certain set of data would be located in and returns that zone. The LDA code also utilizes eigenvalues as an indication of how well that function differentiates groups. As the eigenvalue increases, the better the zones of the table tents differentiate.

Below are two graphs: the graph on the left is the output of the LDA code in Python and the graph on the right is the output of the LDA code in Golang.


Eleanor is an engineering intern at Radius Networks, she will graduate from The Potomac School in McLean, Virginia in June 2019. Started an all-girls robotics team in her freshman year and participated in the World Robotics Championship in April 2018. Eleanor plans to pursue a major in a STEM related field in college.

Continue Reading...