• 模式识别


    处理多演示样例学习(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]; %整合測试




  • 相关阅读:
    P1486 [NOI2004]郁闷的出纳员
    P1966 火柴排队
    P2627 修剪草坪
    P1621 集合
    P1025 数的划分
    中国剩余定理
    P2043 质因子分解
    P1075 质因数分解
    C#之引用类型参数
    C#之方法的定义及调用学习案例
  • 原文地址:https://www.cnblogs.com/hrhguanli/p/3802758.html
Copyright © 2020-2023  润新知