This is a MATLAB solution to the Melbourne University AES/MathWorks/NIH Seizure Prediction (https://www.kaggle.com/c/melbourne-university-seizure-prediction).
It is built upon a winning solution (https://github.com/drewabbot/kaggle-seizure-prediction) from a previous Kaggle seizure competition (https://www.kaggle.com/c/seizure-prediction), using lassoGLM models from the Statistics and Machine Learning Toolbox.
The zip file contains:
1. calculate_features.m -- a function that calculates a set of features from the iEEG sample values
2. step1_generate features -- a function that loads in patient training (and test) iEEG sample data and calculates features (using function calculate_features.m).
3. step2_generate_models.m -- a function that trains a LASSO GLM model using the features extracted from step1_generate_features.m.
4. step3_evaluate_models.m -- a function that evaluates the trainted model and returns in-sample and out-of-sample skill for model assessment. Output is stored to a .csv file for Kaggle submission.
5. step4_predict_seizure.m -- a function that make predictions on test data, with the model trained and evaluated from the previous steps. Output is stored to a .csv file for Kaggle submission.
6. kaggle_seizure_prediction_workflow.m -- a master script that runs through the above-mentioned steps.
Jianghao Wang (2021). Kaggle: seizure prediction MATLAB solution -- LASSO GLM approach (https://www.mathworks.com/matlabcentral/fileexchange/59158-kaggle-seizure-prediction-matlab-solution-lasso-glm-approach), MATLAB Central File Exchange. Retrieved .
The error message was due to 100% or near 100% data dropout (see https://www.kaggle.com/c/melbourne-university-seizure-prediction/data: A handful of 10-minute segments contain 100% data drop-out and cannot be classified. The data may also contain artifacts such as large amplitude rapid signal transitions that can be removed from analysis), which introduces complex values when calculating features.
Workaround solutions include:
1) only take real parts of the matrix and then run lassoGLM;
2) identify 100% data dropout and artifacts, and exclude them from the beginning of your analysis.
When running step2_generate_models.m, there is an error saying that the X_train is not a real-value 2D matrix in the lassoglm function. Did you have this problem?
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!