title: ValueError: Input 0 of layer sequential_2 is incompatible with the layer:
body: <p>i have a error in following code , error in 2st part on code and on first part i am declaring my dataset , layers etc.</p>
  <pre><code>import numpy as np # linear algebra
  import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
  import matplotlib.pyplot as plt
  import seaborn as sns
  
  data=pd.read_excel('/content/dataset.xlsx')
  data.head()
  
  data.plot(kind='scatter', x='fiyat', y='yil',alpha = 0.5,color = 'red')
  plt.xlabel('price')              # label = name of label
  plt.ylabel('year')
  plt.title('Fiyat ve yil Scatter Plot') 
  
  data.plot(kind='scatter', x='fiyat', y='km',alpha = 0.5,color = 'grey')
  plt.xlabel('price')              # label = name of label
  plt.ylabel('km')
  plt.title('Fiyat ve km Scatter Plot') 
  data.plot(kind='scatter', x='fiyat', y='motor_gucu_hp',alpha = 0.5,color = 'green')
  plt.xlabel('price')              # label = name of label
  plt.ylabel('machine power')
  plt.title('fiyat ve motor_gucu_hp Scatter Plot') 
  
  # Importing the dataset
  X = data.iloc[:, data.columns != 'fiyat']
  y = data.fiyat
  
  # Splitting the dataset into the Training set and Test set
  from sklearn.model_selection import train_test_split
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)
  
  from sklearn.preprocessing import StandardScaler
  sc = StandardScaler()
  X_train = sc.fit_transform(X_train)
  X_test = sc.transform(X_test)
  
  from keras.models import Sequential
  from keras.layers import Dense
  from keras.wrappers.scikit_learn import KerasRegressor
  from sklearn.preprocessing import StandardScaler
  from matplotlib import pyplot as plt
  import seaborn as sns
  import warnings
  warnings.filterwarnings('ignore')
  from sklearn.model_selection import train_test_split
  
  # define base model
  def baseline_model():
      # create model
      model = Sequential()
      model.add(Dense(30, input_dim=120, kernel_initializer='normal', activation='relu'))
      model.add(Dense(120, activation = 'relu'))
      model.add(Dense(120, activation = 'relu'))
      model.add(Dense(1, kernel_initializer='normal'))
      # Compile model
      model.compile(loss='mse',
                  optimizer='adam',
                  metrics=['mae'] )
      return model
  
  model = baseline_model()
  model.summary()
  </code></pre>
  <blockquote>
  <p>And getting error in here ; on model.fit location</p>
  </blockquote>
  <pre><code>import tensorflow as tf
  from tensorflow import keras
  import numpy as np
  
  
  # Display training progress by printing a single dot for each completed epoch
  EPOCHS = 500
  
  # Store training stats
  history = model.fit(X_train, y_train, epochs=EPOCHS,
                      batch_size=16, verbose=0)
  </code></pre>
  <p>ValueError: Input 0 of layer sequential_2 is incompatible with the layer: expected axis -1 of input shape to have value 120 but received input with shape (None, 47)</p>
  <p>And error like this , can you help? What can i do.</p>