Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. for...
  2. new_line['x'] = a
  3. new_line['y'] = b
  4. new_line['z'] = a + math.cos(math.pi * b)
  5. rows_list.append(new_line)
  6.  
  7. dataset = pd.DataFrame(rows_list, columns=['x','y','z'])
  8. ...
  9.  
  10.  
  11.     model = keras.Sequential([
  12.         layers.Dense(8, activation='relu', input_shape=[len(features.keys())]),
  13.         layers.Dense(8, activation='relu'),
  14.         layers.Dense(1, activation='relu')
  15.     ])
  16.  
  17.     optimizer = tf.keras.optimizers.RMSprop(learning_rate=0.005)
  18.  
  19.     model.compile(loss='mse',
  20.                   optimizer=optimizer,
  21.                   metrics=['mae', 'mse'])
  22.  
  23.     model.fit(features, labels, validation_split=0.2, epochs=500)
  24.  
  25.  
  26. ...
  27. print("Expected | Predicted")
  28. #  iterating over rows using iterrows() function
  29. for i, j in example_labels.iterrows():
  30.     print(j[0], example_result[i][0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement