# Machine Learning with sometimes missing data

I'm trying to do an indoor locationing system based on my RSSI signal on my routers, I'm sniffing my network so I know what's the RSSI of my phone related to my routers antennas (I have 5 antennas all over my house).

The iPhone is not always broadcasting probe requests so I only get know in-real time the RSSI signal related to the router the device is connected to and no the other routers. To make it simple to understand: I sometimes have the RSSI of a device related to the 5 routers and sometimes only to 3 and in the worst case escenario only to 1 so my data sometimes looks like this:

room: 1, device_id: 1, rssi1: -80, rssi2: unknown, rssi3: -55, rssi4: unknown, rssi5: unknown


or:

room: 1, device_id: 1, rssi1: -80, rssi2: -95, rssi3: -55, rssi4: -102, rssi5: -96


or:

room: 1, device_id: 1, rssi1: -80, rssi2: unknown, rssi3: unknown, rssi4: unknown, rssi5: unknown


It is room based, so I'm not triangulating. I am trying to forecast in which room I am inside the house just by looking on the behaviour of the signals.

Machine Learning would be perfect, but if the data was always there and not some values missing sometimes. What kind of data algorithm should I use for this scenarios when sometimes I have all the data and sometimes just a few.

• The ideal solution would be to have a probability distribution over the parameters and marginalize the missing ones. – Emre Jun 27 '16 at 21:47
• Depending on your usage but replacing with a mean value would be a good approach as a first step! – Erhard Dinhobl Jun 28 '16 at 10:22
• – DaL Jun 28 '16 at 11:52
• @Emre What if I build different models with just the data I have? So I have one model for when I have 3 parameters only, then another model for when I have 6 parameters, etc. – Carlos C Jun 30 '16 at 19:37
• You can do that. What fraction of your data is missing; is it random, or does it follow a pattern? It would help to update your question with relevant details. – Emre Jun 30 '16 at 19:56

There are couple of ways to deal with missing data.

• Replace missing values by mean/median. If the missing values is very less, then this method would be apt. Also depends on how skewed your data is.
• Imputation. Build a linear regression model to predict the missing values based on other parameters. KNN could also be used to predict the missing value

Also there are other methods to deal with missing data such as mimicking the parameters, removing missing data, etc.

• If the idea is to use k nearest neighbors (makes sense when the # data points is not very high) why not directly determine the target using kNN (based on whatever attributes are available)instead of first imputing the missing attributes and then using a regression model? – wabbit Jun 28 '16 at 14:38
• Missing a very common approach that can go with the mean/median approach - adding a (typically 0 or 1 valued) column that explicitly records whether the data was originally present. Sometimes absence of the value is a predictive feature by itself. – Neil Slater Jul 1 '16 at 7:02

If only a small fraction of features is missing you can use imputation. For more serious cases, you can use a probabilistic model such as a Gaussian process, which will let you marginalize the missing features. Or alternatively, train a neural network with dropout regularization. When you have missing data, just "drop out" the missing connections for real. Since your network is already trained for missing features, it should work fine without them.

Missing values in matlab would be replaced by value indicators.The following values, for instance, would be easily cleaned:

• A period (.)
• NA
• NaN
• -99
• Empty cells