模式识别 - 处理多演示样例学习(MIL)特征(matlab)
生活随笔
收集整理的這篇文章主要介紹了
模式识别 - 处理多演示样例学习(MIL)特征(matlab)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
處理多演示樣例學習(MIL)特征(matlab)
本文地址:?http://blog.csdn.net/caroline_wendy/article/details/27206325
多演示樣例學習(MIL)的特征(features)包括, "演示樣例編號+視頻編號+標簽+特征"的形式;
須要組成多演示樣例學習特定包的形式, 每個元胞是一個多演示樣例包, 后面一位是標簽, 即"特征包+標簽"的形式;
代碼:
%author @ C.L.Wang %time @ 2014.5.27 %matlab @ R2012a%% 載入數據 clc, clear; features = load('ViolenceMILFeatures.txt');%% 提取多演示樣例包 head = features(:,1:3); % 頭部信息 video_vector = features(:,2); % 視頻名稱 total_num = size(unique(video_vector),1); video_cell = cell(total_num,2); for video_num = 1:total_numtemp = find(video_vector==video_num);video_cell{video_num,1} = features(temp(1,1):temp(end,1),4:end);video_cell{video_num,2} = features(temp(1,1),3); end%% 分類訓練和測試 negative_train_features = video_cell(1:(total_num/4), :); negative_test_features = video_cell((total_num/4+1):(total_num*2/4), :); positive_train_features = video_cell((total_num*2/4+1):(total_num*3/4), :); positive_test_features = video_cell((total_num*3/4+1):end, :);train_features = [positive_train_features; negative_train_features]; %整合訓練 test_features = [positive_test_features; negative_test_features]; %整合測試轉載于:https://www.cnblogs.com/hrhguanli/p/3802758.html
總結
以上是生活随笔為你收集整理的模式识别 - 处理多演示样例学习(MIL)特征(matlab)的全部內容,希望文章能夠幫你解決所遇到的問題。

- 上一篇: DedeCms如何调用Discuz论坛主
- 下一篇: JavaScript学习笔记——unde