title: TensorFlow predict User's next number
body: <p><strong>UPDATED</strong></p>
  <p>So my goal is to create a machine learning program that takes a list of training numbers given by a user, and try to predict what number they might pick next. I am fairly new to machine learning, and wanted to make this quick project just for fun. Some issues that I am running into include: not knowing how to update my training labels to correspond to training for the next number and how to go about predicting that next number. Here is my current code:</p>
  <pre><code>import tensorflow as tf
  from tensorflow import keras
  import numpy as np
  import matplotlib.pyplot as plt    # I will add a visualization and other things later
  
  
  train_numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]
  train_labels = [1, 2, 3, 4, 5, 6, 7, 8, 9]
  test_number = 2    # These values will be changed into inputs later to collect individual data
  
  model = keras.Sequential([
      keras.layers.Input(shape=(1,)),    # Is this the correct way to input my data? I want 1 number to pass through here
      keras.layers.Dense(10, activation='relu'),
      keras.layers.Dense(1, activation='softmax')    # Later I want to input any number I want, but for now I will output a prediction number 1-10
  ])
  
  model.compile(optimizer='adam',
                loss='mse',
                metrics=['mae'])
  
  model.fit(train_numbers, train_labels, epochs=2)    # I am not sure if my fitting here works, my code does not make it here
  
  predictions = model.predict(test_number)
  print(predictions)
  </code></pre>
  <p>Here is my current error and traceback:</p>
  <pre><code>    Traceback (most recent call last):
    File &quot;C:/Users/Mason Choi/PycharmProjects/machine_learning/experimentation.py&quot;, line 23, in &lt;module&gt;
      predictions = model.predict(test_number)
    File &quot;C:\Users\Mason Choi\anaconda3\envs\machine_learning\lib\site-packages\tensorflow\python\keras\engine\training.py&quot;, line 130, in _method_wrapper
      return method(self, *args, **kwargs)
    File &quot;C:\Users\Mason Choi\anaconda3\envs\machine_learning\lib\site-packages\tensorflow\python\keras\engine\training.py&quot;, line 1569, in predict
      data_handler = data_adapter.DataHandler(
    File &quot;C:\Users\Mason Choi\anaconda3\envs\machine_learning\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py&quot;, line 1105, in __init__
      self._adapter = adapter_cls(
    File &quot;C:\Users\Mason Choi\anaconda3\envs\machine_learning\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py&quot;, line 650, in __init__
      self._internal_adapter = TensorLikeDataAdapter(
    File &quot;C:\Users\Mason Choi\anaconda3\envs\machine_learning\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py&quot;, line 275, in __init__
      num_samples = set(int(i.shape[0]) for i in nest.flatten(inputs))
    File &quot;C:\Users\Mason Choi\anaconda3\envs\machine_learning\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py&quot;, line 275, in &lt;genexpr&gt;
      num_samples = set(int(i.shape[0]) for i in nest.flatten(inputs))
    File &quot;C:\Users\Mason Choi\anaconda3\envs\machine_learning\lib\site-packages\tensorflow\python\framework\tensor_shape.py&quot;, line 887, in __getitem__
      return self._dims[key].value
  IndexError: list index out of range
  
  Process finished with exit code 1
  </code></pre>
  <p>Am I going about this the wrong way? Any help welcome, THANKS!</p>