Projects

2021

Using Stochastic Simulation to Evaluate Whether the Quality or Quantity of Shots Improves Probability of Winning in Ice Hockey

GitHub - stevenhirsch/hockey-xG-quality-vs-quantity-of-shots
Contribute to stevenhirsch/hockey-xG-quality-vs-quantity-of-shots development by creating an account on GitHub.
Read more about this project! (Click to expand)
A pertinent tactical question in territory sports is whether a higher amount of low-quality shots at goal versus a lower amount of high-quality shots at goal results in different probabilities of winning a match. Others have already reported that teams with a lower amount of high-quality shots are more likely to win soccer matches than teams with a higher amount of low-quality shots. However, the points awarded for winning and losing are allocated differently in soccer versus hockey. Therefore, the results from soccer can't be extrapolated directly to ice hockey.

The purpose of this analysis was to assess whether a lower amount of high-quality shots results in higher expected points (xPTS) relative to a higher amount of low-quality shots in ice hockey. I hypothesized that a lower amount of high-quality shots would accumulate more xPTS than a higher amount of low-quality shots due to the xPTS findings from soccer. Further supporting this hypothesis is the current trend in basketball to prioritize shooting three-point shots to improve the probability of winning.

The findings from my stochastic simulation analysis (which included 10 million simulated "games") supported my hypothesis that teams are projected to win more points if they generate a lower quantity of high-quality shots relative to their opponent (assuming the same total expected goals).

Evaluating Skeletal Muscle Mitochondrial Capacity with NIRS Data

GitHub - stevenhirsch/Evaluating-Skeletal-Muscle-Mitochondrial-Capacity-with-NIRS-data: Colab notebook to estimate mitochondrial capacity based on near-infrared spectroscopy data.
Colab notebook to estimate mitochondrial capacity based on near-infrared spectroscopy data. - GitHub - stevenhirsch/Evaluating-Skeletal-Muscle-Mitochondrial-Capacity-with-NIRS-data: Colab notebook ...
Read more about this project! (Click to expand)
I put together a pipeline for researchers who use near-infrared spectroscopy (NIRS) data to evaluate skeletal muscle mitochondrial capacity.

Existing implementations of this analysis in the literature are with Matlab, so I wrote this code in Python (which is free) using a Colab notebook (also free). By creating and sharing the code this way, anybody with a web browser can "run" it and perform the analysis (without needing to install Python on a local machine, which is often a challenge with transferring code to scientists with limited programming experience). In my opinion, creating and sharing code in this way is vital for ensuring research findings can be replicated between labs and promoting the more general Open Science movement. It also lowers the barriers for researchers who want to conduct these analyses but don't yet have the programming skills required.

The code provides data comparable to that published in the literature. If you have used it to publish any research, please let me know!

Human Motion Analysis with Kinetic V2

GitHub - stevenhirsch/Human-Motion-Analysis-with-Kinect-v2: Python code to analyze joint angles during exercise from Kinect v2.
Python code to analyze joint angles during exercise from Kinect v2. - GitHub - stevenhirsch/Human-Motion-Analysis-with-Kinect-v2: Python code to analyze joint angles during exercise from Kinect v2.
Read more about this project! (Click to expand)
Some researchers have used joint-center data from Kinect to quantify segment and joint angles. However, it is possible to export quaternion data for each segment to compute 3D joint angles instead of 2D joint angles with the joint centers. The advantage of 3D angles is that they provide information about joint motion in multiple axes simultaneously and provide values more similar to that of biomechanics studies in the literature. This alignment with the methods in the literature is crucial for people who wish to compare their findings to published data. Therefore, I created this open-source project that allows anyone with Kinect v2 to collect 3D biomechanical data easily.

There are more technical details contained within the GitHub page. Current implementations of this code appear to provide reliable data for sagittal plane knee and hip joint angles compared to laboratory-grade, multi-camera markerless motion capture systems (with the caveat, of course, that all joints are visible by the single-camera and depth sensor of the Kinect).

This code can be used, for free, by researchers, clinicians, and trainers who want to leverage a cheap and easy-to-use motion capture system without cumbersome equipment or proprietary software.

2020

Finite Difference Python Function

GitHub - stevenhirsch/finitedifferencepython
Contribute to stevenhirsch/finitedifferencepython development by creating an account on GitHub.
Read more about this project! (Click to expand)
My primary motivation for writing this code was to analyze position transducer data to compute sprinting velocity. Most default python functions (to my knowledge) do not allow for much flexibility for computing finite differences. This code calculates the coefficients required to compute finite differences while specifying the desired order accuracy using the Taylor Expansion. This code has come in handy for some velocity-based training-related work I've done, but users can also adapt it for other purposes. The function seems accurate up to the 13th derivative of a sine wave, which is more than sufficient for most applications.

2019

Predicting Sepsis in ICU Patients Before Symptom Onset using Deep Learning

GitHub - stevenhirsch/CHL7001_Sepsis
Contribute to stevenhirsch/CHL7001_Sepsis development by creating an account on GitHub.
Read more about this project! (Click to expand)
Early detection of sepsis in the ICU can drastically reduce the risk of adverse health outcomes and perhaps even death. We hypothesized that it would be feasible that some relationship exists between clinical measures such as age, sex, heart rate, mean arterial pressure, oxygen saturation, body temperature, and other variables that would be indicative of developing sepsis in the following hours. Given the amount of data, we felt that deep learning approaches would be well-suited for predicting sepsis.

Our final model performance, based on the unique Utility score for the competition, was 0.370, which would have ranked us 58th out of 256, or in about the top 25% (again, we didn't register for the competition as it was over when we started the class project). Given we completed the project in much less time than was allotted for the competition, and this was collectively our first neural network project, we were relatively happy with it! However, the model's overall accuracy would suggest that it wasn't very effective for predicting sepsis in the hours before its development. Whether this is a result of limited data, the algorithms we implemented, or the problem is much more complex than we initially thought requires further investigation.

We used Microsoft NNI on the Google Cloud Platform (GCP) to automate the neural network architecture search and hyperparameter tuning. We also used data from a Computing in Cardiology Challenge (n= 40,336 patients, each with 41 clinical measures, 40 of which were time-dependent and shifted 6 hours ahead, totalling 1,522,210 observations). However, we only used the data from this challenge and did not compete. Since there were multiple methods in which we could pre-process the data (imputation method, missing threshold, number of past hours, upsampling ratio, extra padding), generate a model architecture (RNN type, number of RNN layers, RNN layer size, RNN dropout, number of dense layers, dense layer size, and dense dropout), and perform gradient descent (sepsis weight class, optimizer, batch size, learning rate, decay, momentum), we used these as hyperparameters in NNI. However, since we had about 18 million hyperparameters, grid searching was impossible since it would have taken about 5 million years to examine one model at a time on GCP. We, therefore, used a mix of Bayesian and Evolutionary Optimization with our split GCP course credits.