Body: <p>I'm working with data that is ranked. So the inputs are 1,2,3 etc. This means the smaller numbers (ranks) are preferred to the larger ones. Hence the order is important. I want to estimate a number using regression; however, with the constraint that the order of the numbers must be monotonic non-linear.</p>
  <p>Imagine the following input table:</p>
  <pre><code>1, 2
  2, 3
  3, 1
  </code></pre>
  <p>For instance, if the output is 1000 for each input, then the estimation could be:</p>
  <pre><code>1 * (800) + 2 * (100) = 1000
  2 * (300) + 3 * (60) = 780
  3 * (150) + 1 * (400) = 850
  </code></pre>
  <p>Evidently, the estimated Xs are monotonic non-linear decreasing.
  For the first column: 1 -&gt; 800, 2 -&gt; 600 (2x300), 3 -&gt; 450 (3x150)
  for the second columns: 1 -&gt; 400, 2 -&gt; 200 (2x100), 3-&gt; 180 (2x60)</p>
  <p>So here's the question. Can I ensure my model (neural network) enforces the given constraint? I am using Keras.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-20T17:24:18.270Z
Comments.Text: hi, do you mean that you want a control on the output of the network w.r.t the order of the inputs you put in?
Comments.UserDisplayName: A. Maman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-21T15:08:37.637Z
Comments.Text: Do you think you could pre-process the inputs so that they come in order?
Comments.UserDisplayName: mark mark
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-21T18:37:04.230Z
Comments.Text: No. I mean to put a constraint when finding the weights (or preferably neuron) that the less value the input neuron has the more values should be found to solve the regression problem. Pre-processing is not a bad idea, but the problem is that I have thousands of features that all describe an order for an input row.
Comments.UserDisplayName: Gergő Barta
Tags: <neural-networks><machine-learning><deep-learning><keras>
Title: Can I constrain my neurons in a neural network in according to the orders of the input?
UserDisplayName: Gergő Barta
ThreadText: # Can I constrain my neurons in a neural network in according to the orders of the input?
  
  (Asked by: username_0 on 2020-12-19)
  
  I'm working with data that is ranked. So the inputs are 1,2,3 etc. This means the smaller numbers (ranks) are preferred to the larger ones. Hence the order is important. I want to estimate a number using regression; however, with the constraint that the order of the numbers must be monotonic non-linear.
  
  Imagine the following input table:
  
  ```
  1, 2
  2, 3
  3, 1
  
  ```
  
  For instance, if the output is 1000 for each input, then the estimation could be:
  
  ```
  1 * (800) + 2 * (100) = 1000
  2 * (300) + 3 * (60) = 780
  3 * (150) + 1 * (400) = 850
  
  ```
  
  Evidently, the estimated Xs are monotonic non-linear decreasing.
  For the first column: 1 -> 800, 2 -> 600 (2x300), 3 -> 450 (3x150)
  for the second columns: 1 -> 400, 2 -> 200 (2x100), 3-> 180 (2x60)
  
  So here's the question. Can I ensure my model (neural network) enforces the given constraint? I am using Keras.
  
  **Tags:** neural-networks, machine-learning, deep-learning, keras
  
  > **Comments:**
  > **username_1**: hi, do you mean that you want a control on the output of the network w.r.t the order of the inputs you put in?  
  > **username_2**: Do you think you could pre-process the inputs so that they come in order?  
  > **username_0**: No. I mean to put a constraint when finding the weights (or preferably neuron) that the less value the input neuron has the more values should be found to solve the regression problem. Pre-processing is not a bad idea, but the problem is that I have thousands of features that all describe an order for an input row.  
  
  ---
  
  ## 0 answers
  
  