{"id":1,"date":"2021-11-14T18:07:52","date_gmt":"2021-11-14T18:07:52","guid":{"rendered":"http:\/\/natashaqayyum.com\/?p=1"},"modified":"2022-04-07T12:23:24","modified_gmt":"2022-04-07T12:23:24","slug":"hello-world","status":"publish","type":"post","link":"https:\/\/natashaqayyum.com\/?p=1","title":{"rendered":"Feature Selection to Optimise Human Activity Recognition Model"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"0-optimising-training-time-and-reducing-computational-demands\">Optimising Training Time and Reducing Computational Demands<\/h2>\n\n\n<div class=\"wp-block-ub-table-of-contents-block ub_table-of-contents\" data-showtext=\"show\" data-hidetext=\"hide\" data-scrolltype=\"auto\" id=\"ub_table-of-contents-a2005529-def8-4343-852c-277ee9a581dc\" data-initiallyhideonmobile=\"false\"\n                    data-initiallyshow=\"true\"><div class=\"ub_table-of-contents-header-container\"><div class=\"ub_table-of-contents-header\">\n                    <div class=\"ub_table-of-contents-title\">Contents<\/div><div class=\"ub_table-of-contents-header-toggle\">\n                        <div class=\"ub_table-of-contents-toggle\">\n                        &nbsp;[<a class=\"ub_table-of-contents-toggle-link\" href=\"#\">hide<\/a>]<\/div><\/div><\/div><\/div><div class=\"ub_table-of-contents-extra-container\"><div class=\"ub_table-of-contents-container ub_table-of-contents-1-column \"><ul><li><a href=https:\/\/natashaqayyum.com\/?p=1#1-setting-the-scene>Setting the Scene<\/a><\/li><li><a href=https:\/\/natashaqayyum.com\/?p=1#2-the-dataset>The Dataset<\/a><\/li><li><a href=https:\/\/natashaqayyum.com\/?p=1#3-objective>Objective<\/a><\/li><li><a href=https:\/\/natashaqayyum.com\/?p=1#4-data-frame-pre-processing>Data Frame Pre-Processing<\/a><\/li><li><a href=https:\/\/natashaqayyum.com\/?p=1#5-exploratory-data-analysis-eda>Exploratory Data Analysis (EDA)<\/a><\/li><li><a href=https:\/\/natashaqayyum.com\/?p=1#7-feature-selection>Feature Selection<\/a><\/li><li><a href=https:\/\/natashaqayyum.com\/?p=1#8-building-ml-model-and-results>Building ML Model and Results<\/a><\/li><\/ul><\/div><\/div><\/div>\n\n\n<h3 class=\"has-luminous-vivid-orange-color has-text-color wp-block-heading\" id=\"1-setting-the-scene\">Setting the Scene<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Picture somebody performing 20 star jumps, followed by 20 burpees, followed by 20 sit ups.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, imagine these same exercises &#8211; however this time they are performed atop a multi-touch pressure sensing mat.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The pressure mat resembles a yoga mat, with 512 embedded pressure sensors aligned in a 32 x 16 matrix. Each sensor records a pressure reading (Kg\/cm^2) against their timestamp, with a 10-20ms dynamic response time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every second has the potential to produce thousands of datapoints.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>If we were to plot the sensor readings against time, we would expect:<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em>The 20 star jumps \u2014&gt; Rapid changes in total pressure from zero to x as the subject jumps and lands on the mat. Only a small subset of the pressure sensors would ever be triggered, concentrated around the feet.<\/em><\/li><li><em>The 20 burpees \u2014&gt; Similar to the above, we would see total pressure vary from zero to x. However, a far wider range of pressure sensors across the mat will be triggered.<\/em><\/li><li><em>The 20 sit ups \u2014&gt; Total pressure should never equal zero, as the subject is continually sat on the mat. We would see intermittent increases and decreases as the subject\u2019s back touches and lifts from the ground.<\/em><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-style-rounded\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"219\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2021\/11\/Screenshot14-1024x219.png\" alt=\"\" class=\"wp-image-340\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2021\/11\/Screenshot14-1024x219.png 1024w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2021\/11\/Screenshot14-300x64.png 300w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2021\/11\/Screenshot14-768x164.png 768w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2021\/11\/Screenshot14-1536x329.png 1536w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2021\/11\/Screenshot14.png 1990w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"has-luminous-vivid-orange-color has-text-color wp-block-heading\" id=\"2-the-dataset\">The Dataset<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/archive.ics.uci.edu\/ml\/datasets\/MEx\" target=\"_blank\" rel=\"noreferrer noopener\">MEx<\/a> is a research level, multi-model experimental dataset that was recommended by a prior data science manager of mine to analyse.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The experiment saw <strong>30<\/strong> <strong>individuals<\/strong> perform <strong>seven different dynamic physiotherapy exercises<\/strong> on a pressure sensing mat.<\/p>\n\n\n\n<h3 class=\"has-luminous-vivid-orange-color has-text-color wp-block-heading\" id=\"3-objective\">Objective<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The aim of my analysis is to demonstrate a beneficial application of feature selection when designing a machine learning (ML) model. The ML model will ultimately be used to predict which physiotherapy exercise is being performed, according to sensor readings. The feature selection aspect is to test my hypothesis &#8211; <strong>there are pressure sensors within the matrix which offer little to no useful information and therefore can be excluded from the model input. <\/strong>All while still accurately predicting the exercise being performed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Benefits of feature selection include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Reduced training times<\/strong><\/li><li><strong>Reduced computational requirements<\/strong><\/li><li><strong>Remove irrelevant features, for example those pressure points which have never picked up a signal<\/strong><\/li><li><strong>Reduce overfitting, separating the signal from the noise<\/strong><\/li><\/ul>\n\n\n\n<h3 class=\"has-luminous-vivid-orange-color has-text-color wp-block-heading\" id=\"4-data-frame-pre-processing\">Data Frame Pre-Processing<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">I began by reading in a few examples of the 210 .csv files to observe the data\u2019s structure and volume. I conducted typical data quality tests and sense checks &#8211; including checking for nulls and appropriate data types.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, I concatenated all the .csv files into one master data frame. I engineered the following additional features to aid analysis:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em><strong>Subject <\/strong>&#8211;&gt; The individual performing the exercise. This information was originally found in the folder structure.<\/em><\/li><li><em><strong>Exercise<\/strong> &#8211;&gt; The exercise number (1-7) performed by the subject. This information was originally in the .csv file name.<\/em><\/li><li><em><strong>a_Time<\/strong> &#8211;&gt; The actual time and date these readings were recorded.<\/em><\/li><li><em><strong>r_Time<\/strong> &#8211;&gt; The relative time these readings were recorded.<\/em><\/li><li><em><strong>Total_p<\/strong> &#8211;&gt; The total pressure on the mat at that point in time (sum of the 512 sensors).<\/em><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">I also renamed columns 1-512 into 1_1 to 32_16, to represent the X-Y coordinates of the sensor on the mat. The new data frame was checked for data quality and saved locally to aid future processing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"385\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot1-1024x385.png\" alt=\"Original data structure of one .csv (a single subject performing one exercise), showing a timestamp plus one dimension per pressure sensor.\" class=\"wp-image-306\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot1-1024x385.png 1024w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot1-300x113.png 300w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot1-768x289.png 768w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot1-1536x578.png 1536w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot1-1920x724.png 1920w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot1.png 1924w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Original data structure of one .csv (<em>a single subject performing one exercise<\/em>), showing a timestamp plus one dimension per pressure sensor.<\/figcaption><\/figure>\n\n\n<div class=\"wp-block-ub-content-toggle\" id=\"ub-content-toggle-7d68fec8-547e-4986-8666-f93d2f15caec\" data-mobilecollapse=\"true\" data-desktopcollapse=\"true\">\n<div class=\"wp-block-ub-content-toggle-accordion\" id=\"ub-content-toggle-panel-block-\">\n                <div class=\"wp-block-ub-content-toggle-accordion-title-wrap\"\" aria-controls=\"ub-content-toggle-panel-0-7d68fec8-547e-4986-8666-f93d2f15caec\" tabindex=\"0\">\n                    <p class=\"wp-block-ub-content-toggle-accordion-title ub-content-toggle-title-7d68fec8-547e-4986-8666-f93d2f15caec\">Code to build data frame that maintains original folder structure as new features<\/p><div class=\"wp-block-ub-content-toggle-accordion-toggle-wrap left\"><span class=\"wp-block-ub-content-toggle-accordion-state-indicator wp-block-ub-chevron-down\"><\/span>\n                    <\/div><\/div><div role=\"region\" aria-expanded=\"false\" class=\"wp-block-ub-content-toggle-accordion-content-wrap ub-hide\" id=\"ub-content-toggle-panel-0-7d68fec8-547e-4986-8666-f93d2f15caec\">\n\n<pre class=\"wp-block-code\"><code>debug = False\n\n#defining the root directory of the pressure mat data\npmRoot = \"data\/\"\n\n#timing information - start timer\nstart = timer()\n\n#for subjects 1 to 30\nfor i in range(1, 31):\n    \n    #for exercises 1 to 7\n    for j in range(1, 8):\n        \n        #read in a pressure mat data frame\n        \n        #formatting the numbers to match file system\n        if(i&lt;10): folder = \"0\" + str(i) + \"\/\"\n        else: folder = str(i) + \"\/\"\n        file = \"0\" + str(j) + \"_pm_1.csv\"\n        \n        #read in the .csv files\n        if (debug == True): print(pmRoot + folder + file)\n        pm_df_in = pd.read_csv(pmRoot + folder + file)\n        \n        #calculate the total pressure for each time increment\n        pm_temp_totals = pm_df_in.drop(pm_df_in.columns&#91;0], axis = 1).sum(axis = 1)\n        \n        #reformatting the time string into an actual datetime object\n        for k in range(len(pm_df_in)):\n            timeString = pm_df_in.iloc&#91;k,0]\n            if len(timeString) &lt; 20:\n                timeString = timeString + \".\"\n            while len(timeString) &lt; 26:\n                timeString = timeString + \"0\"\n            pm_df_in.iat&#91;k,0] = datetime.strptime(timeString, \"%Y-%m-%d %H:%M:%S.%f\")\n        \n        #create a measure of absolute time for each data point\n        pm_temp_a_Time = pm_df_in.iloc&#91;:,0]\n        \n        #create a measure of relative time for each data point\n        #have to do this in a for loop for some reason?\n        pm_temp_r_Time = &#91;None] * len(pm_temp_a_Time)\n        for time in range(len(pm_temp_a_Time)):\n            pm_temp_r_Time&#91;time] = pm_temp_a_Time&#91;time] - pm_temp_a_Time&#91;0]\n        \n        #create a dataframe to store our bad boys in\n        pm_temp_df = pd.DataFrame(columns = colNames)\n        \n        #add in our data\n        pm_temp_df&#91;\"a_Time\"] = pm_temp_a_Time\n        pm_temp_df&#91;\"r_Time\"] = pm_temp_r_Time\n        pm_temp_df&#91;\"Total_p\"] = pm_temp_totals\n        \n        pm_temp_df&#91;coords] = pm_df_in.iloc&#91;:,1:len(pm_df_in.columns)]\n        \n        #label the data with the subject and exercise\n        pm_temp_df&#91;\"Subject\"] = pd.Series(&#91;i for x in range(len(pm_temp_df.index))], index=pm_temp_df.index)\n        pm_temp_df&#91;\"Exercise\"] = pd.Series(&#91;j for x in range(len(pm_temp_df.index))], index=pm_temp_df.index)\n        \n        #append to our dataframe\n        pm_df = pm_df.append(pm_temp_df)\n        \n#         break\n#     break\n\n#timing information - end timer\nend = timer()\ndt = end - start\nprint(\"Importing time elapsed: {:.2f}\".format(dt))\n\npm_df<\/code><\/pre>\n\n<\/div><\/div>\n<\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"513\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot2-1024x513.png\" alt=\"New data frame to be used for analysis, containing information from all 210 .csv files plus additional features.\" class=\"wp-image-318\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot2-1024x513.png 1024w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot2-300x150.png 300w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot2-768x384.png 768w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot2-1536x769.png 1536w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot2.png 2018w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>New data frame to be used for analysis, containing information from all 210 .csv files plus additional features.<\/figcaption><\/figure>\n\n\n\n<h3 class=\"has-luminous-vivid-orange-color has-text-color wp-block-heading\" id=\"5-exploratory-data-analysis-eda\">Exploratory Data Analysis (EDA)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">I began by picking a few timestamps and visualising their respective row of data. A heat map proves the perfect visualisation for representing pressure on a mat. This is how the pressure mat\u2019s native software visualises pressure readings.<\/p>\n\n\n<div class=\"wp-block-ub-content-toggle\" id=\"ub-content-toggle-f2f49078-128b-4245-bc5e-7cca486861d6\" data-mobilecollapse=\"true\" data-desktopcollapse=\"true\">\n<div class=\"wp-block-ub-content-toggle-accordion\" id=\"ub-content-toggle-panel-block-\">\n                <div class=\"wp-block-ub-content-toggle-accordion-title-wrap\"\" aria-controls=\"ub-content-toggle-panel-0-f2f49078-128b-4245-bc5e-7cca486861d6\" tabindex=\"0\">\n                    <p class=\"wp-block-ub-content-toggle-accordion-title ub-content-toggle-title-f2f49078-128b-4245-bc5e-7cca486861d6\">Code to visualise heatmat<\/p><div class=\"wp-block-ub-content-toggle-accordion-toggle-wrap left\"><span class=\"wp-block-ub-content-toggle-accordion-state-indicator wp-block-ub-chevron-down\"><\/span>\n                    <\/div><\/div><div role=\"region\" aria-expanded=\"false\" class=\"wp-block-ub-content-toggle-accordion-content-wrap ub-hide\" id=\"ub-content-toggle-panel-0-f2f49078-128b-4245-bc5e-7cca486861d6\">\n\n<pre class=\"wp-block-code\"><code>#1520 is just a nice one, can alter the row number to anything\nrowNum = 1520\n\n#create an array using the pressure point readings in the specified row \nheatmapData = pm_df.iloc&#91;rowNum, 6:len(pm_df.columns)].to_numpy() #start from column index 6 until the end\nheatmapData = heatmapData.reshape(32, 16).astype(float) #reshape the datapoints into a 32x16 grid\n\nplt.figure(figsize=(16, 8)) #defining the size and dimensions of the graph\nsns.heatmap(heatmapData.T, vmin=0, vmax=1550) #display the heatmap with defined scale\n#sns.heatmap(heatmapData.T) #display the heatmap with relative scale<\/code><\/pre>\n\n<\/div><\/div>\n<\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"590\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot3-1024x590.png\" alt=\"Visualising row number 1520 - subject appears on their hands and knees.\" class=\"wp-image-317\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot3-1024x590.png 1024w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot3-300x173.png 300w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot3-768x442.png 768w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot3-1536x885.png 1536w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot3.png 1576w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Visualising row number 1520 &#8211; subject appears on their hands and knees.<\/figcaption><\/figure>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"562\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot5-1024x562.png\" alt=\"Row number 185115 - subject appears to be standing.\" class=\"wp-image-315\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot5-1024x562.png 1024w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot5-300x165.png 300w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot5-768x422.png 768w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot5-1536x844.png 1536w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot5.png 1602w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Row number 185115 &#8211; subject appears to be standing.<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"562\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot4-1024x562.png\" alt=\"Row number 137022, appearing to be a jump.\" class=\"wp-image-316\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot4-1024x562.png 1024w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot4-300x165.png 300w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot4-768x422.png 768w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot4-1536x844.png 1536w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot4.png 1602w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Row number 137022, appearing to be a jump.<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"562\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot6-1024x562.png\" alt=\"Row number 84260 - subject appears on their side (feet, hip and hand).\" class=\"wp-image-314\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot6-1024x562.png 1024w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot6-300x165.png 300w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot6-768x422.png 768w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot6-1536x844.png 1536w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot6.png 1602w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Row number 84260 &#8211; subject appears on their side (feet, hip and hand).<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Next, some distribution graphs to understand the wider dataset:<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"716\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot7.png\" alt=\"Distribution of sensor readings by subject.\" class=\"wp-image-313\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot7.png 762w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot7-300x282.png 300w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><figcaption>Distribution of sensor readings by subject.<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"716\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot8.png\" alt=\"Distribution of sensor readings by exercise.\" class=\"wp-image-312\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot8.png 762w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot8-300x282.png 300w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><figcaption>Distribution of sensor readings by exercise.<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"716\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot9.png\" alt=\"Distribution of total pressure for a given timestamp.\" class=\"wp-image-311\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot9.png 762w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot9-300x282.png 300w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><figcaption>Distribution of total pressure for a given timestamp.<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p class=\"wp-block-paragraph\">The most common total pressure for a given timestamp is zero i.e. when there is no subject on the mat (including jumps).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because the exercises are dynamic over time, a still snapshot is not enough information for a model to classify the exercise by. Therefore I wanted to deduce whether each exercise had its own distinct pattern when plotted against time.<\/p>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"6-plotting-subplots-for-each-exercise-showing-the-total-pressure-recorded-against-time\">Plotting subplots for each exercise, showing the total pressure recorded against time.<\/h4>\n\n\n<div class=\"wp-block-ub-content-toggle\" id=\"ub-content-toggle-7c0b2a77-9566-495c-b101-4c872f6dab42\" data-mobilecollapse=\"true\" data-desktopcollapse=\"true\">\n<div class=\"wp-block-ub-content-toggle-accordion\" id=\"ub-content-toggle-panel-block-\">\n                <div class=\"wp-block-ub-content-toggle-accordion-title-wrap\"\" aria-controls=\"ub-content-toggle-panel-0-7c0b2a77-9566-495c-b101-4c872f6dab42\" tabindex=\"0\">\n                    <p class=\"wp-block-ub-content-toggle-accordion-title ub-content-toggle-title-7c0b2a77-9566-495c-b101-4c872f6dab42\">Code to visualise total exercise pressure against time<\/p><div class=\"wp-block-ub-content-toggle-accordion-toggle-wrap left\"><span class=\"wp-block-ub-content-toggle-accordion-state-indicator wp-block-ub-chevron-down\"><\/span>\n                    <\/div><\/div><div role=\"region\" aria-expanded=\"false\" class=\"wp-block-ub-content-toggle-accordion-content-wrap ub-hide\" id=\"ub-content-toggle-panel-0-7c0b2a77-9566-495c-b101-4c872f6dab42\">\n\n<pre class=\"wp-block-code\"><code># plotting total pressure against time\n\nwhichsubject = 1\nwhichexercise = 1\nnumexercise = 7\n\nfig, ax = plt.subplots(numexercise)\n\nfor i in range(1,numexercise+1):\n    exercise = pm_df.loc&#91;(pm_df&#91;'Subject'] == whichsubject) &amp; (pm_df&#91;'Exercise'] == i)]\n    ax&#91;i-1].plot(exercise.loc&#91;:,'r_Time'], exercise.loc&#91;:,'Total_p']) #plot relative time against total pressure\n    #ax&#91;i-1].get_yaxis().set_visible(False) #hide y axis\n    ax&#91;i-1].get_xaxis().set_visible(False) #hide x axis\n    ax&#91;i-1].title.set_text(\"Exercise {}\".format(i)) #set titles per subplot according to exercise number\n    plt.subplots_adjust(top=2, hspace=0.75) #adjust spacing between subplots<\/code><\/pre>\n\n<\/div><\/div>\n<\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"702\" height=\"1024\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot10-702x1024.png\" alt=\"Total pressure of all sensors against time.\" class=\"wp-image-310\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot10-702x1024.png 702w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot10-206x300.png 206w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot10-768x1120.png 768w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot10.png 794w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><figcaption>Total pressure of all sensors against time.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I was pleased to find a few of the exercises had distinctly repetitive patterns.<\/p>\n\n\n\n<h3 class=\"has-luminous-vivid-orange-color has-text-color wp-block-heading\" id=\"7-feature-selection\">Feature Selection<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">I explored two methods of feature selection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first method was to manually calculate the <strong>approximate entropy (ApEn) <\/strong>of each feature. ApEn is a technique that measures the regularity and predictability of each dimension, which should in theory aid the selection of the most \u2018useful\u2019 sensors for a ML model.<\/p>\n\n\n<div class=\"wp-block-ub-content-toggle\" id=\"ub-content-toggle-aadab615-1f9c-43fd-8a32-7466de2cd632\" data-mobilecollapse=\"true\" data-desktopcollapse=\"true\">\n<div class=\"wp-block-ub-content-toggle-accordion\" id=\"ub-content-toggle-panel-block-\">\n                <div class=\"wp-block-ub-content-toggle-accordion-title-wrap\"\" aria-controls=\"ub-content-toggle-panel-0-aadab615-1f9c-43fd-8a32-7466de2cd632\" tabindex=\"0\">\n                    <p class=\"wp-block-ub-content-toggle-accordion-title ub-content-toggle-title-aadab615-1f9c-43fd-8a32-7466de2cd632\">Code to calculate ApEn<\/p><div class=\"wp-block-ub-content-toggle-accordion-toggle-wrap left\"><span class=\"wp-block-ub-content-toggle-accordion-state-indicator wp-block-ub-chevron-down\"><\/span>\n                    <\/div><\/div><div role=\"region\" aria-expanded=\"false\" class=\"wp-block-ub-content-toggle-accordion-content-wrap ub-hide\" id=\"ub-content-toggle-panel-0-aadab615-1f9c-43fd-8a32-7466de2cd632\">\n\n<pre class=\"wp-block-code\"><code># define a function that calculates the approximate entropy\n# from https:\/\/en.wikipedia.org\/wiki\/Approximate_entropy\n\ndef ApEn(U, m, r) -&gt; float:\n    \"\"\"Approximate_entropy.\"\"\"\n\n    def _maxdist(x_i, x_j):\n        return max(&#91;abs(ua - va) for ua, va in zip(x_i, x_j)])\n\n    def _phi(m):\n        x = &#91;&#91;U&#91;j] for j in range(i, i + m - 1 + 1)] for i in range(N - m + 1)]\n        C = &#91;\n            len(&#91;1 for x_j in x if _maxdist(x_i, x_j) &lt;= r]) \/ (N - m + 1.0)\n            for x_i in x\n        ]\n        return (N - m + 1.0) ** (-1) * sum(np.log(C))\n\n    N = len(U)\n\n    return abs(_phi(m + 1) - _phi(m))\n\n# calculate the ApEn for each feature\n\ncolumn_apen = &#91;]\n\nfor i in tqdm(range(len(sub1ex2.columns))):\n    column_apen.append(ApEn(sub1ex2.iloc&#91;:,i].values, 2, 3))\n    \n#plot the distribution of ApEn values\nsns.displot(column_apen)<\/code><\/pre>\n\n<\/div><\/div>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">I then compared ApEn results against an out-the-box feature selection module, the <strong>mutual information (MI) regression<\/strong> from sci-kit learn. This method is an example of univariate feature selection, whereby the best features are selected based on univariate statistical tests. We compare each feature (pressure reading of a specific sensor) to the target variable (total pressure), to see whether there is any statistically significant relationship between them. It is also called analysis of variance (ANOVA), commonly used in Biological applications, where I first came across this methodology.<\/p>\n\n\n<div class=\"wp-block-ub-content-toggle\" id=\"ub-content-toggle-2679003e-0ddf-42cc-a6ce-b53d08864d8f\" data-mobilecollapse=\"true\" data-desktopcollapse=\"true\">\n<div class=\"wp-block-ub-content-toggle-accordion\" id=\"ub-content-toggle-panel-block-\">\n                <div class=\"wp-block-ub-content-toggle-accordion-title-wrap\"\" aria-controls=\"ub-content-toggle-panel-0-2679003e-0ddf-42cc-a6ce-b53d08864d8f\" tabindex=\"0\">\n                    <p class=\"wp-block-ub-content-toggle-accordion-title ub-content-toggle-title-2679003e-0ddf-42cc-a6ce-b53d08864d8f\">Code to calculate MI<\/p><div class=\"wp-block-ub-content-toggle-accordion-toggle-wrap left\"><span class=\"wp-block-ub-content-toggle-accordion-state-indicator wp-block-ub-chevron-down\"><\/span>\n                    <\/div><\/div><div role=\"region\" aria-expanded=\"false\" class=\"wp-block-ub-content-toggle-accordion-content-wrap ub-hide\" id=\"ub-content-toggle-panel-0-2679003e-0ddf-42cc-a6ce-b53d08864d8f\">\n\n<pre class=\"wp-block-code\"><code>#calculating mutual information between each individual sensor result and the total pressure\n\nfrom sklearn.feature_selection import mutual_info_classif\n\nmutInf = sklearn.feature_selection.mutual_info_regression(sub1ex2.values, sub1ex2_df&#91;'Total_p'].values)\n\n#plotting mutual information against number of features\nsns.displot(mutInf)<\/code><\/pre>\n\n<\/div><\/div>\n<\/div>\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"716\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot11.png\" alt=\"Approximate Entropy (ApEn) distribution.\" class=\"wp-image-309\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot11.png 762w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot11-300x282.png 300w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><figcaption>Approximate Entropy (ApEn) distribution.<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"716\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot12.png\" alt=\"Mutual Information (MI) regression distribution.\" class=\"wp-image-308\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot12.png 762w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot12-300x282.png 300w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><figcaption>Mutual Information (MI) regression distribution.<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Over half of all features have an ApEn value of zero or near zero, meaning they are so regular that they are predictable all the time and offer no meaningful information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Likewise, over half of all features show an MI of zero, indicating the features are independent of, and therefore have no impact on, the total pressure. A higher MI value indicates a higher dependency.<\/p>\n\n\n<div class=\"wp-block-ub-content-toggle\" id=\"ub-content-toggle-7ac3a96a-66a5-462b-a4c5-f5a8781913a5\" data-mobilecollapse=\"true\" data-desktopcollapse=\"true\">\n<div class=\"wp-block-ub-content-toggle-accordion\" id=\"ub-content-toggle-panel-block-\">\n                <div class=\"wp-block-ub-content-toggle-accordion-title-wrap\"\" aria-controls=\"ub-content-toggle-panel-0-7ac3a96a-66a5-462b-a4c5-f5a8781913a5\" tabindex=\"0\">\n                    <p class=\"wp-block-ub-content-toggle-accordion-title ub-content-toggle-title-7ac3a96a-66a5-462b-a4c5-f5a8781913a5\">Code to apply feature selection to the dataset<\/p><div class=\"wp-block-ub-content-toggle-accordion-toggle-wrap left\"><span class=\"wp-block-ub-content-toggle-accordion-state-indicator wp-block-ub-chevron-down\"><\/span>\n                    <\/div><\/div><div role=\"region\" aria-expanded=\"false\" class=\"wp-block-ub-content-toggle-accordion-content-wrap ub-hide\" id=\"ub-content-toggle-panel-0-7ac3a96a-66a5-462b-a4c5-f5a8781913a5\">\n\n<pre class=\"wp-block-code\"><code>#create a list of centiles that will be used to reduce the volume of features in the df\n\n#100% of dataset reduced by 30% each time:\nreduce = 0.3\ncurrent = 100\ncentiles = &#91;]\n\nwhile current &gt; 1:\n    centiles.append(current)\n    current = current * (1 - reduce)\n\n#print(centiles)\n\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.model_selection import train_test_split, cross_val_score\nfrom sklearn.feature_selection import SelectPercentile, mutual_info_classif\n\nX = pm_df_fs #all the pressure sensor features\nY = pm_df&#91;'Exercise'] #the target i.e. exercise number\n\nprint(X.shape)\n\nstart = timer()\n\nX_list = &#91;]\n\nfor i in tqdm(range(len(centiles))):\n    X_list.append(SelectPercentile(mutual_info_classif, centiles&#91;i]).fit_transform(X, Y))\n    print(\"Number of features retained: {}\".format(X_list&#91;i].shape&#91;1]))\n\nend = timer()\ndt = end - start\nprint(\"Feature selecting time elapsed: {:.2f}s\".format(dt))<\/code><\/pre>\n\n<\/div><\/div>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">I applied the feature selection in a manner that creates 13 different datasets with a volume reduction of 30% each time. This way I can compare the ML performance of a model using all 512 features, against a model using only 358 features, then 251 features and so on. Each time removing the features deemed least useful.<\/p>\n\n\n\n<h3 class=\"has-luminous-vivid-orange-color has-text-color wp-block-heading\" id=\"8-building-ml-model-and-results\">Building ML Model and Results<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How does feature selection within a large dataset affect the performance of a ML model to predict physical human activity?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this dataset, the type of exercise being performed by the subject is our target to be predicted. Because this is a discrete data type, it forms an interesting classification problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>K-Nearest Neighbors classifier (KNN)<\/strong> was used in this analysis &#8211; it is a simple supervised machine learning algorithm which utilises observations within known classes <em>(labeled data in our training set which tells us what pressure measurements are typical of which exercises<\/em>). It then compares these against observations (<em>pressure readings<\/em>) with an unknown class &#8211; matching them according to proximity.<\/p>\n\n\n<div class=\"wp-block-ub-content-toggle\" id=\"ub-content-toggle-a6facaf4-7317-49d1-bc2d-cb4246360cbf\" data-mobilecollapse=\"true\" data-desktopcollapse=\"true\">\n<div class=\"wp-block-ub-content-toggle-accordion\" id=\"ub-content-toggle-panel-block-\">\n                <div class=\"wp-block-ub-content-toggle-accordion-title-wrap\"\" aria-controls=\"ub-content-toggle-panel-0-a6facaf4-7317-49d1-bc2d-cb4246360cbf\" tabindex=\"0\">\n                    <p class=\"wp-block-ub-content-toggle-accordion-title ub-content-toggle-title-a6facaf4-7317-49d1-bc2d-cb4246360cbf\">Code to build and run KNN model<\/p><div class=\"wp-block-ub-content-toggle-accordion-toggle-wrap left\"><span class=\"wp-block-ub-content-toggle-accordion-state-indicator wp-block-ub-chevron-down\"><\/span>\n                    <\/div><\/div><div role=\"region\" aria-expanded=\"false\" class=\"wp-block-ub-content-toggle-accordion-content-wrap ub-hide\" id=\"ub-content-toggle-panel-0-a6facaf4-7317-49d1-bc2d-cb4246360cbf\">\n\n<pre class=\"wp-block-code\"><code>from sklearn.metrics import confusion_matrix\nfrom sklearn.metrics import classification_report\n\nneigh = KNeighborsClassifier(n_neighbors=3)\n\nfit_time = &#91;]\npredict_time = &#91;]\nreports = &#91;]\n\nfor i in range(len(centiles)): #for each volume of data\n    start = timer()\n    x_train, x_test, y_train, y_test = train_test_split(X_list&#91;i], Y) #for each dataset in x_list (30% stepwise feature reduction), split the dataset into training and testing sets.\n    neigh.fit(x_train, y_train) #run the training data through the KNN\n    end = timer()\n    fit_time.append(end - start) #record the training time. this will help us compare model performance\n    print(\"Fitting time elapsed for {} columns: {:.2f}s\".format(x_train.shape&#91;1], fit_time&#91;i]))\n    \n    start = timer()\n    pred = neigh.predict(x_test) #run test data through our trained KNN to predict exercise performed\n    end = timer()\n    predict_time.append(end - start) #record the prediction time. this will help us compare model performance\n    print(\"Predicting time elapsed: {:.2f}s\".format(predict_time&#91;i]))\n\n    c_mat = confusion_matrix(y_test, pred) #compare the test predictions against the actual target (hidden to trained model). produce a confusion matrix.\n    print(\"Confusion matrix:\\n{}\".format(c_mat))\n    \n    reports.append(classification_report(y_test, pred, output_dict = True)) #writes a report of results\n    print(reports&#91;i])\n    \n    print(\"\\n\\n\")   <\/code><\/pre>\n\n<\/div><\/div>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The true intention of this analysis is to prove feature selection can improve the performance of a model, with additional computational benefits as a by-product. More information does not necessarily produce a more accurate model, due to noise and over-fitting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The final step is to measure the levels of classification precision after reducing the sensor volume by 30% in a stepwise manner.<\/p>\n\n\n<div class=\"wp-block-ub-content-toggle\" id=\"ub-content-toggle-086ab77e-1a28-4bc7-9eb2-db6ede55bced\" data-mobilecollapse=\"true\" data-desktopcollapse=\"true\">\n<div class=\"wp-block-ub-content-toggle-accordion\" id=\"ub-content-toggle-panel-block-\">\n                <div class=\"wp-block-ub-content-toggle-accordion-title-wrap\"\" aria-controls=\"ub-content-toggle-panel-0-086ab77e-1a28-4bc7-9eb2-db6ede55bced\" tabindex=\"0\">\n                    <p class=\"wp-block-ub-content-toggle-accordion-title ub-content-toggle-title-086ab77e-1a28-4bc7-9eb2-db6ede55bced\">Code to plot KNN performance against dataset volume<\/p><div class=\"wp-block-ub-content-toggle-accordion-toggle-wrap left\"><span class=\"wp-block-ub-content-toggle-accordion-state-indicator wp-block-ub-chevron-down\"><\/span>\n                    <\/div><\/div><div role=\"region\" aria-expanded=\"false\" class=\"wp-block-ub-content-toggle-accordion-content-wrap ub-hide\" id=\"ub-content-toggle-panel-0-086ab77e-1a28-4bc7-9eb2-db6ede55bced\">\n\n<pre class=\"wp-block-code\"><code>#pull macro average precision results from the above reports into a list\nmacro_avg = &#91;]\n\nfor i in range(len(reports)):\n    macro_avg.append(reports&#91;i]&#91;'macro avg']&#91;'precision'])\n\nt = list(range(len(centiles)))\n\nnumCol = &#91;]\nfor i in range(len(X_list)):\n    numCol.append(X_list&#91;i].shape&#91;1])\n    \nfig, ax1 = plt.subplots()\n\ncolor = 'tab:red'\nax1.set_xlabel('Number of Columns Used')\nax1.set_ylabel('Macro Average Precision', color=color)\nax1.plot(t, macro_avg, color=color)\nax1.tick_params(axis='y', labelcolor=color)\n\nplt.xticks(t, numCol)\n\nax2 = ax1.twinx() #instantiate a second axes that shares the same x-axis\n\ncolor = 'tab:blue'\nax2.set_ylabel('Prediction Time (s)', color=color)  #already handled the x-label with ax1\nax2.plot(t, predict_time, color=color)\nax2.tick_params(axis='y', labelcolor=color)\n\nfig.tight_layout()  #otherwise the right y-label is slightly clipped\nplt.show()<\/code><\/pre>\n\n<\/div><\/div>\n<\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"890\" height=\"568\" src=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot13.png\" alt=\"In red, plotting the macro average precision of the K-Nearest Neighbors (KNN) classification model against the number of columns used to train the model. In blue, plotting the time in seconds taken for the model to perform a classification prediction. \" class=\"wp-image-307\" srcset=\"https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot13.png 890w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot13-300x191.png 300w, https:\/\/natashaqayyum.com\/wp-content\/uploads\/2022\/04\/Screenshot13-768x490.png 768w\" sizes=\"auto, (max-width: 890px) 100vw, 890px\" \/><figcaption>In red, plotting the macro average precision of the K-Nearest Neighbors (KNN) classification model against the number of columns used to train the model.\nIn blue, plotting the time in seconds taken for the model to perform a classification prediction. \n<\/figcaption><\/figure>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color has-medium-font-size wp-block-paragraph\"><strong>Ta-da! There is an immediate increase in the macro average precision of the model upon removing 30% of features from the dataset. In addition to this, the time taken to make a prediction has decreased.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All code for this analysis can be found on my GitHub repo <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/natasha-qayyum\/feature-selection\" target=\"_blank\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"entry-summary\">\nOptimising Training Time and Reducing Computational Demands Setting the Scene Picture somebody performing 20 star jumps, followed by 20 burpees, followed by 20 sit ups. Next, imagine these same exercises &#8211; however this time they are performed atop a multi-touch pressure sensing mat. The pressure mat resembles a yoga mat, with 512 embedded pressure sensors&hellip;\n<\/div>\n<div class=\"link-more\"><a href=\"https:\/\/natashaqayyum.com\/?p=1\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &ldquo;Feature Selection to Optimise Human Activity Recognition Model&rdquo;<\/span>&hellip;<\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ub_ctt_via":"","footnotes":""},"categories":[4],"tags":[13,6,7,5,11],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-data-science","tag-biology","tag-data-science","tag-feature-selection","tag-machine-learning","tag-python","entry"],"acf":[],"featured_image_src":null,"author_info":{"display_name":"admin","author_link":"https:\/\/natashaqayyum.com\/?author=1"},"_links":{"self":[{"href":"https:\/\/natashaqayyum.com\/index.php?rest_route=\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/natashaqayyum.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/natashaqayyum.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/natashaqayyum.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/natashaqayyum.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1"}],"version-history":[{"count":20,"href":"https:\/\/natashaqayyum.com\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":351,"href":"https:\/\/natashaqayyum.com\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions\/351"}],"wp:attachment":[{"href":"https:\/\/natashaqayyum.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/natashaqayyum.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/natashaqayyum.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}