## 2 Materials and Methods
We created different versions of the dataset with label encodings and one-hot vector encodings for comparison. We also created two multilabel datasets whose correct output encoded both the port number and the disorder strength of the disordered waveguide (i.e., the number of scatterers, \(N_{s}\)) that produced the intensity distribution of the transmission eigenchannels. For the first dataset, the one-hot vector encoding was a 30-component vector with the first ten positions corresponding to the ports of the disordered waveguides with 300 scatterers, the second ten positions to the disordered waveguides with 400 scatterers, and the last ten positions to the waveguides with 500 scatterers, with the ten positions corresponding to the ten ports on each configuration. For the second dataset, the one-hot vector was a 13-component vector with the first ten positions corresponding to the ports on the optical device and the last three positions corresponding to the number of scatterers (300, 400, and 500 respectively). This is a supervised multi-class classification problem. It is supervised because the correct intensity distribution-port pairings are provided as labeled training data. It is a multi-class classification problem because there are ten different classes, corresponding to ten different ports, and each input, or intensity distribution of a transmission eigen-channel, can only belong to a single port. Figure 3: Diagrams explaining how the decision trees and neural networks were used for the classification task – the vertical-colored lines indicate the different intensity distribution values at different spatial points used for classification: (**a**) Diagram theoretically showing how the trained decision tree classifier can be used to classify an intensity distribution. Through training, the classifier creates the shown branching structure and learns which values of the distribution and which threshold value lead to the correct port number classification at the leaves of the tree; (**b**) Diagram theoretically showing how the trained neural network can be used to classify an intensity distribution. In the 451-neuron input layer, one value of the intensity distribution is assigned to one neuron in the order dictated by the distribution. Learned weights between the layers result in a 10-neuron one-hot vector with one port being marked as the predicted port. Two machine learning algorithms were tested: a fully-connected neural network and a decision tree. The fully-connected neural network consisted of an input layer (451 neurons), three hidden layers (2048 neurons, 1024 neurons, and 512 neurons), and an output layer (10 neurons). For each iteration, a batch of 128 intensity distributions was passed through the model. In the input layer, one value of the intensity distribution was assigned to one neuron in the order dictated by the energy density distribution. In the hidden layers, all the neurons in the previous layer were connected with a certain weight value to each neuron in the next layer. The value that a neuron adopted in the next layer was the sum of all the neurons in the previous layer multiplied by their weights connecting them to that neuron. The ReLU activation function [33] dictated which neurons were activated and passed on their values to the next layer. In between each layer was a batch normalization layer that normalized these values based on the mean of the current batch and the added training stability. In the output layer, the softmax activation function converted these values into probabilities between 0.0 and 1.0 for each port number. Due to this setup, the one-hot vector encoding label representation was used for the fully-connected neural network. The position in the output vector with the highest probability corresponded to the predicted port number.