# How to deal with features which are here just for training?

I'm new to the Data Science field and last week I started to learn about Neural Networks and Deep Learning. To practice, I decided to do a small project: design a Neural Network to predict the winner of an NBA game given the two teams playing. Also, for each match I have 2 stats (let's say number of points and number of free throws) for each of the teams.

In the end, the dataset looks like:

|  ID |  Home |  Away | H_Pts | H_Fts | A_Pts | A_Fts | H_win |
|:---:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|
|  1  | Team1 | Team2 |   45  |   10  |   47  |   8   |   1   |
|  2  | Team3 | Team4 |   56  |   6   |   70  |   13  |   0   |
| ... |  ...  |  ...  |  ...  |  ...  |  ...  |  ...  |  ...  |


I implemented the model with TensorFlow/Keras (with the help of this tutorial: Classify structured data with feature columns | TensorFlow Core).

The code is pretty concise:

batch_size = 16
train_ds, test_ds, val_ds = get_datasets()  # The function mainly uses tf.data.Dataset.from_tensor_slices((dict(dataframe), labels))
team_names = get_team_names()

feature_columns = []
for column_name in ['Home', 'Away']:
team = feature_column.categorical_column_with_vocabulary_list(column_name, team_names)
feature_columns.append(feature_column.indicator_column(team))

for column_name in ['H_Pts', 'H_Fls', 'A_Pts', 'A_Fls']:
feature_columns.append(feature_column.numeric_column(column_name))

feature_layer = tf.keras.layers.DenseFeatures(feature_columns)

model = tf.keras.Sequential([
feature_layer,
layers.Dense(128, activation='relu'),
layers.Dense(128, activation='relu'),
layers.Dense(1)
])


Trained with just 100 games, I get a great accuracy: 99%. Of course: as it is, the test dataset given to model.evaluate(test_ds) contains everything except the target label H_win. Because H_win can easily be deduced from H_Pts and A_Pts, I get a high accuracy. But this model can't work because by definition you don't know the number of points of each team before the game...