LFP analysis and classification of metastases
The MATLAB function [trainingData, testData, trainingLines, testLines] = process_data(trainingDataRaw, testDataRaw)
.
-
Inputs
trainingDataRaw
: table loaded from training_data.xlsxtestDataRaw
: table loaded from test_data.xlsx
-
Output
trainingLines
: name of the animal line of each row of the training sessionstestLines
: name of the animal line of each row of the test sessions
Already trained decision trees are loaded in decision-trees/decision_trees.mat. They can be used to predict new data into sham
, breast
, melanoma
or lung
categories can be achieved with:
prediction = decisionTrees{iModel}.predict(trainingData.X);
The MATLAB function confusion_matrix(ytrue, ypred, classNames, <optional>)
computes and plots a confusion matrix with predictions of all models.
-
Mandatory Inputs
ytrue
:N x 1
vector of true classesypred
:N x #models
vector of predicted classes. Each column is prediction from a particular modelclassNames
: names of classes (e.g. {sham
,breast
,melanoma
,lung
})
-
Optional Inputs
title
: plot title. None by defaultcLims
: color limits. Non by defaultplotText
: boolean indicating whether to show confusion matrix numbers. True by defaultsaveName
: complete path for saving the confusion matrix. images/confusion_matrix.png by default
-
Optional Outputs
confMat
:#classes x #classes
confusion matrix.
Output example