## 3 Experimental Data Acquisition
In the data collection stage, we use seven APs from predefined locations, and the other reachable APs are used from unknown locations because, in real-world situations, specifically in complex and hierarchical buildings, it is difficult to know all of the APs' location. However, signals from unknown locations may be important. During data collection, we have seen that there are up to 53 reachable APs. Hence, considering APs from unknown locations is very important to obtain important information. The RSS values and BSSIDs are the collected features, and the X-Y coordinates are Wi-Fi users' locations that are recorded during data collection. Table 1 indicates the structure of the recorded database containing the ranges of RSS values and the corresponding BSSIDs, and the position of the collecting grids. At the beginning, the scanned database is recorded in the form of [(\(RSS_{\text{k}}^{1}\),..  
values were filled using average values. However, it is unrealistic to represent all missed APs with similar values when there will be more than one missed AP. In [28], the authors used selective APs for localization. However, in this type of approach, it is very difficult to implement whenever larger numbers of APs are missed. Therefore, in our case, we filled the missed RSS values using regression, and then applied LDA for dimensional reductions. As discussed in [29; 30], high dimensionality has problems, such as requiring a large amount of time, high space complexity, and high over-fitting problems. Through appropriate application of dimensionality reduction techniques, it is possible to project a set of high-dimensional vector samples into much lower dimensionality while preserving the relevant global structure information of the data [31]. This also makes it easy to visualize and manipulate the intrinsic structure of the projected samples. According to [30], LDA is used for supervised approaches of dimensional reductions. The main goal of the dimensionality reduction techniques is to reduce the redundant and dependent features by transforming the higher dimensional feature space, which may lead to the curse of dimensionality problem, to a space with lower dimensions. Discussions in [32] suggest that LDA has been used to extract the most discriminative location features by maximizing the between-class scatter under the constraint of keeping within-class scatter value. LDA is fast training approach for dimension reduction, so that it helps to improve computational complexity [31]. According to [30; 31], there are two types of LDA technique: class-dependent and class-independent. In class-dependent types, the lower dimensional space is calculated for each class to project its data on it. In this type, there will be a number of projections depending on the numbers of classes, because both eigenvalues and eigenvectors are calculated for each transformation matrix separately. However, class-independent LDA operations are performed by considering each class as a separate class against the other classes in the whole projection. In this type, there will only be one lower dimensional space for all classes. Due to the computational simplicity, we prefer to use the class-independent LDA method. For the simplicity of our work, we coded the datasets into classes based on different parameters, such as LoS, geographical settlements, and reference point with related RSS samples. For example, a room is considered as one class. A corridor found on a floor having the same structure and same LoS is coded as a class. Therefore, before applying LDA, we divide the datasets into 15 classes. In class representations, each class will be considered as a distinct class alongside the other classes. We used LDA as a preprocessor stage, as it is more appropriate to our datasets and helps to optimize by maximizing the between-class separations, and minimizing within-class variability [29; 30].