Advertisement
manul1537

Untitled

May 22nd, 2024 (edited)
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. import pandas as pd
  2. from tensorflow import keras
  3.  
  4. data_train = pd.read_csv('/datasets/train_data_n.csv')
  5. features_train = data_train.drop('target', axis=1)
  6. target_train = data_train['target']
  7.  
  8. data_valid = pd.read_csv('/datasets/test_data_n.csv')
  9. features_valid = data_valid.drop('target', axis=1)
  10. target_valid = data_valid['target']
  11.  
  12.  
  13. model = keras.models.Sequential()
  14. model.add(keras.layers.Dense(units=1, input_dim=features_train.shape[1]))
  15. model.compile(loss='mean_squared_error', optimizer='sgd')
  16. model.fit(features_train, target_train, verbose=2, epochs=5,)
  17. validation_data=(features_valid, target_valid) 
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement