plot_1feature_2clas​s

版本 1.1 (2.7 KB) 作者: Mark Matusevich
Visualises usefulness of a feature for binary classification.
360.0 次下载
更新时间 2014/11/24

查看许可证

When you attempt to classify data in 2 classes based on a single feature, the first thing to do is to review the conditional probability of the point being from the first class given the value of the feature. However, as usual, overfit is creeping in the shadows. Therefore, the amount of data that the conditional probability is based on should be reviewed as well. This function plots on the same graph the conditional probability and histogram of data distribution for each class separately.
For example, let's assume that you are attempting to predict whether the patient will show paroxysmal atrial fibrillation during 24 hour ambulatory ECG recording (stored in boolean vector 'holter') based on value of peak ischemic ST depression during cardiac stress test (stored in vector 'ST').
Use the following commands to initialize the variables:
>> N = 1e3;
>> k = 20;
>> ST = [5+randn(1,N) 2*rand(1,k) 8+2*rand(1,k)];
>> holter = [2+6*rand(1,N)<ST(1:N) true(1,k-1) false(1,k) true];

Now you can visualise the data using the following commands:
>> plot_1feature_2class(ST, holter, 'ST, mm', {'PAF', 'no PAF'})

For additional explanations type: help plot_1feature_2class

This submission is courtesy of Norav Medical (www.norav.com) - the leading company in the fields of PC-ECG, EKG Management systems and related non-invasive cardiac devices.

引用格式

Mark Matusevich (2024). plot_1feature_2class (https://www.mathworks.com/matlabcentral/fileexchange/45580-plot_1feature_2class), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2009b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Histograms 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1

Bins are now calculated based on the range of all the feature values instead of only those of vClass==true. And the probability plot is based on the same bins as the histograms.

Also, include updates from dependents_plot (submission N. 45481).

1.0.0.0