Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- from tensorflow import keras
- data_train = pd.read_csv('/datasets/train_data_n.csv')
- features_train = data_train.drop('target', axis=1)
- target_train = data_train['target']
- data_valid = pd.read_csv('/datasets/test_data_n.csv')
- features_valid = data_valid.drop('target', axis=1)
- target_valid = data_valid['target']
- model = keras.models.Sequential()
- model.add(keras.layers.Dense(units=1, input_dim=features_train.shape[1]))
- model.compile(loss='mean_squared_error', optimizer='sgd')
- model.fit(features_train, target_train, verbose=2, epochs=5,)
- validation_data=(features_valid, target_valid)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement