zoukankan      html  css  js  c++  java
  • 模式识别

    处理多个演示样本研究(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_num
        temp = 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]; %整合測试




    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    Bzoj3339 Rmq Problem
    Bzoj3509 [CodeChef] COUNTARI
    浅析python日志重复输出问题
    mysql练习题
    python学习之思维导图
    python面向对象编程练习
    Python常见下划线
    内置方法
    类的绑定方法与非绑定方法
    封装
  • 原文地址:https://www.cnblogs.com/hrhguanli/p/4686289.html
Copyright © 2011-2022 走看看