My sample data are as follows.
I have a bigger dataset. In this dataset I want to predict the next date text.
The codes I want to run are like this.
import pandas as pd
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from sklearn.model_selection import train_test_split,GridSearchCV,cross_val_score
from sklearn.metrics import mean_squared_error,r2_score
from sklearn import model_selection
from sklearn.neighbors import KNeighborsRegressor
from warnings import filterwarnings
from sklearn.metrics import mean_squared_error, mean_absolute_error
from tensorflow.keras.callbacks import EarlyStopping
filterwarnings('ignore')
data = pd.read_excel("datasets.xlsx")
data.head()
x_train, x_test, y_train, y_test = train_test_split(x,y,test_size=0.2,random_state=10)
model = Sequential()
model.add(Dense(30,activation="relu"))
model.add(Dense(15,activation="relu"))
model.add(Dense(15,activation="relu"))
model.add(Dense(15,activation="relu"))
model.add(Dense(1))
model.compile(optimizer="adam",loss="mse")
model.fit(x=x_train, y = y_train,validation_data=(x_test,y_test),batch_size=50,epochs=300)
I don't know exactly how to separate x and y here.I tried separating x and y as columns before, but I was not successful in this dataset. In this dataset, I need to separate x and y as rows. As you can see I could only create the model Also, do I need to use a tokenizer here? Anyone who can help with a sample code?