code: def train_and_save_model(model_path, labels_path):
      """Trains simple feedforward model for the KDD99 dataset"""
      # Prepare dataset and split it
      data, labels = prepare_dataset(labels_path)
      (
          train_data,
          test_data,
          train_labels,
          test_labels,
      ) = train_test_split(data, labels, test_size=0.2)
  
      # Create categorical map for the embedding layer
      categorical_map = create_categorical_map(data)
      model = make_keras_model(categorical_map)
  
      print(model.summary())
      model.fit(
          train_data,
          train_labels,
          validation_data=(test_data, test_labels),
          epochs=4,
          batch_size=64,
      )
      model.save(model_path)
  
      # Test on a small subset of predictions
      predictions = model.predict(test_data[:10])
      print(predictions)
  
file_path: tcav/tcav/tcav_examples/discrete/kdd99_model.py
imports: from __future__ import division
  from __future__ import print_function
  import os
  import tensorflow
  import argparse
  import numpy
  from sklearn.model_selection import train_test_split
  import sklearn.datasets
  from sklearn.preprocessing import OrdinalEncoder
label_desc: Use image node_id 7 for calling a global function with example usage: train_and_save_model(model_path, labels_path) without return types