6. Model Evaluation
Activity 6.01: Computing the Accuracy and Null Accuracy of a Neural Network When We Change the Train/Test Split
In this activity, we will see that our null accuracy
and accuracy
will be affected by changing the train
/test
split. To implement this, the part of the code where the train/test split was defined has to be changed. We will use the same dataset that we used in Exercise 6.02, Computing Accuracy and Null Accuracy with APS Failure for Scania Trucks Data. Follow these steps to complete this activity:
- Import the required libraries. Load the dataset using the pandas
read_csv
function and look at the firstfive
rows of the dataset:# Import the libraries import numpy as np import pandas as pd # Load the Data X = pd.read_csv("../data/aps_failure_training_feats.csv") y = pd.read_csv("../data/aps_failure_training_target.csv") # Use the head function to get a glimpse data X.head()
The following table shows the output of the preceding code...