1. Main Dish (Idea): This recipe aims to create a predictive soup that can accurately classify different acoustic regimes (types of sound environments) based on sensor data. The final product is a trained classification model ready to predict the noise regime of new, unseen sensor data.
2. Ingredients (Concepts & Components):
- Raw Acoustic Data: Raw
.ancfiles containing sensor readings from various acoustic environments. - Pandas: A sturdy data frame used to hold the time series data.
- NumPy: An array of numbers used for making the code efficient
- Decision Tree Classifier: The main source of prediction
- Scikit-learn (sklearn): A tool set of ML algorithms that helps us create the Decision Tree Classifier
- Training & Testing Split (From sklearn): A mix of data used to properly make the Decision Tree
3. Cooking Process (How It Works):
- Gather Ingredients: Collect all raw
.ancfiles. These will be the prime source of data. - Data Conversion and Cleaning (ANC to CSV):
- For each
.ancfile in a specified directory, open it and read the data. - Reshape the data: Assuming each frame consists of 7 data points, extract data for every frame.
- Create pandas DataFrames from each set of data.
- Combine all the DataFrames of the 7 data points as columns into a single DataFrame.
- Remove incomplete columns (containing NaN values).
- Add a ‘Regime’ column derived from the filename (indicating the type of acoustic regime).
- Save the combined DataFrame into a
.csvfile, with the filename derived from the original.ancfile. - Repeat for another set of
.ancfiles in a different directory (‘ancFilesPlane2’), saving the results into a separate directory (‘csvFilesP2’).
- For each
- Data Preparation: Load the saved
.csvdata using Pandas. Extract the features (sensor readings) and labels (acoustic regimes). - Training and Testing Prep: Mix the data well, splitting it into training and testing sets. 70% of the data goes into the training pot, while 30% is set aside for testing the final flavor.
- Decision Tree Creation: Make the Decision Tree
- Taste Test (Prediction): Use the trained Decision Tree Classifier to predict the acoustic regimes for the test dataset.
- Flavor Check (Accuracy): Compute the accuracy of the model by comparing the predicted regimes with the actual regimes in the test set.
- Repeat: Repeat steps 1-7 for each set of data
4. Serving Suggestion (Outcome):
The finished Acoustic Noise Classification Soup delivers a trained Decision Tree model capable of accurately classifying acoustic environments.

