What would be a good machine learning model to predict the next vending machine location? I want to build a machine learning model to choose a location for the next vending machine in Boston. I want to divide the map into small neighborhood, and I came up with features that are related to the geospatial locations and user information.
One paradox that concerns me is that: we'll use past vending machines' features (X) and sales (y) to train the model; in that case, the model that predict the next vending machine will likely choose some place very close to the old vending machine locations. But at the same time, we wouldn't want to build a vending machine in exactly the same location as an older one.
Additionally, vending machines are usually built one by one as time goes by; the model used to choose the 10th vending machine in the city, and the 1300th vending machine could be very different. This almost made me think this is a time-series problem. How to build a model that can take these problems into consideration? Any insight on features, logistics, or models are all deeply appreciated!
 A: I would try to create some explanatory variables for each geographic location, such as the income distribution at this location, traffic, amount of pedestrians, and similar features. Then I would use the data from existing vending machines to train a model that predicts your response variable from those explanatory variables, e.g. the profit made by a vending machine.
If that works, you can predict for each spot in the city the amount of money made by a vending machine placed there. Then you select the places where this prediction returns particularly favorable values and where you don't already have a vending machine.
You might also do an experiment and place some new vending machines next to already existing ones, use (some function of) the distances to other vending machines as an additional explanatory variable, and thus learn how the "vending machine density" of a location affects the sales of a new vending machine.
I don't really see a time series property here. I would guess that the sales numbers of a vending machine are only affected by the explanatory features referred to above. If the sales numbers of a vending machine depend on those of previously installed vending machines then, I would suspect, only via those features.
A: @whuber made a very good point: "Placing a new vending machine 'cannibalizes' sales from nearby ones". Cannibalization may be desirable or not, depending on whether the OP is eating the market of his competitor, or himself.
Instead of a writing a machine learner to predict locations, it might be more useful to simulate vending machines. We have a City, say 東京, with existing vending machines owned by a number of companies (maybe try modelling as 2, Us and Them). Initially I imagine that the obvious good locations, such railway stations,are taken. We have a number of graphical views, such number of potential customers, distance to nearest machine, revenue of each machine, etc. Now you can model the effects of new locations, and new products, subject to whatever assumptions you may be making. Next step might be allowing the simulation to try out new locations, Monte Carlo style.
A: Let's consider the inputs and outputs for a moment.
Say your model takes as inputs things like sales and geolocation.  The output is if that location is a vending machine or not.
Now...is that useful?  Your model does not tell you where to place a vending machine.  It tells you if that spot on the map is already a vending machine.  That isn't what you want.
What you likely want is to find a location on the map which is not a vending machine and optimizes some criteria (likely potential sales).  You might want:

*

*A lot of foot traffic

*Not to be too close to other vending machines

*etc.

You need to feed in all that information into some sort of function which scores the location in terms of it being a good or bad location based on the above criteria.  Then, you want to find the location which optimizes that function.
A really simple example of this might be to put a vending machine somewhere which is farthest from all other vending machines. Of course this might put the machine in the middle of a field somewhere, which is why you need to add constraints to this optimization somehow.
A: If you want to frame it as a time series problem, then you might want to go the autoregressive decoder route, where you feed in the sequence of past "outputs" (using teacher forcing, as is commonly used to parallelize transformer model training) in addition to your regular input features in order to help the model predict the next location. Note that the time series formulation and using the historical data as ground truth assumes that the historical placements and timings were optimal, which is a shaky assumption. However, you should be able to approximate human performance provided you have supplied your model with enough information.
Note that this is likely a high perplexity task so don't expect your training losses to get very low-- but even an RNN should be a good fit for this. Recurrent memories retain information about likely candidates and can pivot to another close or "next-best" option if the model's top-1 pick in the current timeframe isn't the "best fit" to the historical data.
In any case, it sounds to me like your problem has an inherent autoregressive property. If you wanted to flatten out the time element, the problem becomes something like, "given the currently deployed machines and the other input features, predict a heatmap, top-k or a single-best location for future machines", for which a variety of architectures could be reasonable candidates.
