I'm fairly new to ML and now that I digged through tutorials and documentations I wanted to create a model myself now.

The problem:

I am a carpenter and back then in shool we had a problem where we got multiple example room layouts from living rooms with furniture and should decide where we would advice a new customer where to place any given object based on the customers current room layout and the example layouts we got for analysis.

So I thought will it be possible to train an ML algorithm to do that for me:

What I've got:

Ive created a 15x15 grid where each cell represents a (0.5m x 0.5m) part of the room. Each cell contains an int representing the class of the item in the room e.g:

A B C D ...
None(0) wall(1) wall(1) wall(1)
None(0) wall(1) bed(2) bed(2)
None(0) wall(1) bed(2) bed(2)
None(0) wall(1) bed(2) bed(2)
wall(1) wall(1) bed(2) bed(2)
shelf(3) shelf(3) None(0) None(0)

For input (x) I have tables with data about walls and objects and some blank space (None (0))

As output (y) I'd like to receive any representation of the x,y coordinates of the given item e.g a couch.

For training purposes I thought of creating a "filled" map and an empty map of the same size (15x15) with just the representation of the given object.

The question:

How I understood ML by now I would say:

  • there's no linear relationship between input and output so linear regression is out.
  • so are decision trees or forests.

My first Intuition is to create a NN with a flattend floorplan as input (255 neurons), 2 dense hidden layers and a dens output layer of (255 neurons) outputs.

The problem is in a large room with just a bed in the middle, the wardrobe can stand anywhere as long it's not infront of the door and it's near a wall.

So how to deal with multiple correct outputs in ML?


  • Is a NN even suitable for my problem or am I missing out other suitable models?

  • Is my way of preprocessing the data even correct or should the data be represented in another way to get a better result?

  • Due to the fact that I understood Reinforcement learning as representing actions at any given state it seems that it might be suitable here to train an agent to return all possible positions but there can be many correct solutions, how to teach this to an agent? (Maybe I need a little help on understanding RL)

  • The algorithm should be expandable: It should be able to give reasonable predictions even if there are more parameters come into play like orientation of furniture or age of the person owning the room to gather intel about the positioning.

Please ignore the fact that it's overcomplicating a problem where no ML might need to be used. It's just for learning purposes!:)

If there is documentation or tutorials I'm missing out I'm not afraid of reading up things myself :) So just a short hint which Model is capable of fulfilling my needs would help me gain a deeper understanding of ML processes :)

Any help is highly appreciated!! Thanks in advance:)

  • $\begingroup$ ML models work (best) when results are uniquely defined, maybe given by an unknown function which the ML model will approximate. If results can take multiple different values, then ML is not what is needed $\endgroup$
    – Nikos M.
    Commented Nov 14, 2021 at 14:44

2 Answers 2


I'm not really competent to answer your specific questions about NNs and reinforcement learning, but I suspect that you're a bit optimistic about how these methods can solve all the problems by themselves.

I can think of two options:

As a binary classification problem

The goal would be to predict whether $y$ is a correct arrangement of the furniture for $x$ (note that both $x$ and $y$ are provided as input features). The model has to be trained from a large training set which:

  • is representative of the diverse possible options as input and output
  • contains both positive and negative instances

I would imagine that the main problem here is to build the training set.

As an optimization problem

The idea here would be to score how good an arrangement $y$ is for an input $x$. An exhaustive or genetic search could be used to find the best $y$ for a particular $x$ by trying many possibilities. This requires:

  • Formalizing the problem and the applicable constraints
  • Designing an objective function which can reliably compare two arrangements $y_1$ and $y_2$.

Note that the last solution is the closest to your proposed solution: one way or another, you need to tell the system how to distinguish a good solution from a bad one.

  • $\begingroup$ Thank you for your answer! I would appreciate validation if I got this right:- option 1 would be to create a model for placing e.g a couch in a room and give the position of the couch in a given room and determine if the positioning is good 1 or bad 2. And than feed random positioned couches to the model and it should be able to validate good ones. -Option 2 would be nearly similar to option one but instead of determining if an example is good or bad , create a function that decides this by comparing y1 to y2? $\endgroup$ Commented Nov 13, 2021 at 21:05
  • $\begingroup$ @mathi1651 yes, that's pretty much it. The main difference between these two options is that in (1) the model learns to distinguish good and bad instances from the examples in the data, whereas in (2) the model just applies the predefined function. Of course option (2) requires you to define this custom function, that's the difficulty. $\endgroup$
    – Erwan
    Commented Nov 14, 2021 at 12:14

The problem is might not be well solved by machine learning. One of the primary goals of machine learning is to generalize to unseen data. It is unclear what generalization would be in this context.

It might be more useful to frame the problem as an optimization problem - find the best solution to the observed data and constraints.

In particular, the problem is very similar to bin packing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.