P3: In-Depth Notes on Data Representation and Model Training in Excel

Understanding Excel Sheets in Data Representation

  • Excel sheets are used to represent data points for variables in a structured format.
  • Each column in the sheet corresponds to a feature, and each row represents a data point (or record).

Key Terminology

  • Data Points: Individual entries in the dataset, denoted as xijx_{ij} where ii is the record index and jj is the feature index.
  • Sample Size (n): The number of records present in the dataset.
  • Number of Features (d): The total number of distinct variables being measured for each record.

Data Structure Representation

  • A record can be represented as x<em>i=[x</em>i1,x<em>i2,…,x</em>id]x<em>{i} = [x</em>{i1}, x<em>{i2}, …, x</em>{id}] where:
    • ii ranges from 1 to nn (total records), and
    • jj ranges from 1 to dd (features per record).
  • For example, if i=2i = 2, the record representation for the features could be [2,2.3,…,2.5][2, 2.3, …, 2.5] for d=3d = 3.

Dataset Components

  • Response Variable (y): Each corresponding record also has a response value yiy_i which can be a constant (e.g., a classification label).
  • The notation used for the data can be expressed as (x<em>i,y</em>i)(x<em>i, y</em>i) where yiy_i typically is a 1imes11 imes 1 value.

Dataset Partitioning

  • The dataset is commonly divided into three parts:
    • Training Set: Used to train the model.
    • Validation Set: Used to fine-tune the model parameters and architecture.
    • Testing Set: Used only for evaluating the performance of the model after training.
Time Series vs. Non-Time Series Data
  • Time Series Data: Must predict future values based on past data. Testing data should always be taken from the last segment of the time series.
    • Example: If data is from a timeline up to March 2024, the training data is from earlier months and testing data is from the last window.
  • Non-Time Series Data: Testing data can be sampled from any point in the dataset; e.g., through random sampling.

Need for Validation

  • Validation helps to fine-tune the network parameters during the training stage:
    • During each validation step, the trained model is tested on unseen data to check for overfitting.
    • If there is a significant drop in accuracy (e.g., from training to validation accuracy), then adjustments must be made to improve the network architecture or parameters.

Importance of Testing Data

  • Testing data provides an estimate of how well the model will perform on future, unseen data.
  • It’s crucial that the test data has never been seen by the model during training or validation processes. This simulates real-world scenarios where the model must predict outcomes based on fresh data.
  • The accuracy of the model that you get on the test data reflects its capacity to generalize to new scenarios.