In the dataset the Last column is Y_data and other remaining columns are x_train_data
While slicing and converting it into tensor
Question: What does xy[:, 0:-1] or xy[:, [-1]] mean?
from torch import nn, optim, from_numpy
import numpy as np
xy = np.loadtxt(’./data/diabetes.csv.gz’, delimiter=’,’, dtype=np.float32)
x_data = from_numpy(xy[:, 0:-1])
y_data = from_numpy(xy[:, [-1]])
print(f’X’s shape: {x_data.shape} | Y’s shape: {y_data.shape}’)