登录
首页 » Matlab » 贝叶斯算法

贝叶斯算法

于 2022-02-12 发布 文件大小:1.51 kB
0 156
下载积分: 2 下载次数: 1

代码说明:

load "iris.csv";tictraining_set = [iris(1:ceil(50*2/3),:); iris(51:50 + ceil(50*2/3),:); iris(101:100 + ceil(50*2/3),:)];%取每类的前2/3作为训练集  ceil用于提高效率test_set = [iris(ceil(50*2/3) + 1:50,:); iris(51 + ceil(50*2/3):100,:); iris(101 + ceil(50*2/3):150,:)];%取每类的后1/3作为测试集class1 = test_set(:,5);%记录类标,class1是一个行矩阵class1test_set(:,5) = 0;%便于计算准确度rows1 = find(training_set(:,5) == 1);%找出training_set(:,5) == 1的位置meanValue1 = mean(training_set(rows1,1:4));%计算一到四列的均值stdValue1 = std(training_set(rows1,1:4));%std(x) 算出一到四列的标准偏差。 x可以是一行的matrix或者一个多行matrix矩阵。如果只有一行,那么就是算一行的标准偏差,如果有多行,就是算每一列的标准偏差。rows2 = find(training_set(:,5) == 2);meanValue2 = mean(training_set(rows2,1:4));stdValue2 = std(training_set(rows2,1:4));rows3 = find(training_set(:,5) == 3);meanValue3 = mean(training_set(rows3,1:4));stdValue3 = std(training_set(rows3,1:4));pClass1 = size(rows

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • gmmMatlab
    高斯混合模型的matlab源代码,拭一款经典的程序(Gaussian mixture model matlab source code, taking a classic procedure)
    2008-03-21 21:59:00下载
    积分:1
  • split_step_fourier_method
    说明:  使用分布傅立叶法计算非线性薛定谔方程。可以得到光纤非线性传输特性。(Fourier method using the distribution of nonlinear Schr枚dinger equation. Can be non-linear optical transmission characteristics.)
    2008-10-14 09:34:16下载
    积分:1
  • ckc
    ckc for matlab ofdm code
    2010-04-20 02:00:12下载
    积分:1
  • chengxu
    用MATLAB去除移动车辆行驶过程的阴影,并对视频进行优化(Remove the shadow of the mobile vehicles using MATLAB, and to optimize the video)
    2012-05-07 17:00:05下载
    积分:1
  • matlabgjxhs
    matlab所有的工具箱函数大全,包括了所有的工具箱函数。 (all the Matlab toolbox functions Solutions, including all of the toolbox functions. Matlab toolbox functions of all volumes, including all the Toolbox function.)
    2007-06-25 14:40:10下载
    积分:1
  • star
    Star, rhombus in neatbeans.
    2014-11-14 12:06:53下载
    积分:1
  • mfiles
    matlab仿真基于相对位置的势场函数参数的选取(matlab simulation of the potential field based on the relative position of the selection function parameters)
    2008-08-01 01:03:55下载
    积分:1
  • Adaptnoise
    c_语言,代码,用于数字信号处理开发板 TMS3206713 自适应滤波器,LMS 算法去除噪声。(LMS adaptive filter cancel noise)
    2011-07-04 11:15:37下载
    积分:1
  • MPSK_QAM
    MPSK_QAM,MPASK下的QAM调制方式,供参考(MPSK_QAM, QAM modulation MPASK under reference)
    2014-09-23 21:29:34下载
    积分:1
  • Gabor_Image_Features
    Computation of Gabor Features - Mean Squared Energy, Mean Amplitude
    2015-04-02 01:58:27下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载