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

贝叶斯算法

于 2022-02-12 发布 文件大小:1.51 kB
0 120
下载积分: 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 个回复

  • wienerfilterlern
    low pass filtering and global communication and wiener filter
    2010-08-02 19:18:12下载
    积分:1
  • abc
    异步电机的matlab仿真,三想abc仿真,可供新手学习(Matlab simulation of induction motor, the three would like to abc simulation, for the novice to learn)
    2009-05-20 11:47:44下载
    积分:1
  • HEV_P2
    说明:  simulink建立的混联式HEV整车模型(Hybrid HEV Full Vehicle Model Established by Simlink)
    2020-12-18 14:49:10下载
    积分:1
  • 利用有限元分析目标职位的验证
    validation of goal post by using FE
    2022-01-28 00:52:28下载
    积分:1
  • across-zero-detection
    一种基于调制域分析的过零检测算法改进,克服了传统过零算法不能应用于某些信号的局限,有MATLAB仿真(Zero-crossing detection algorithm based on improved modulation domain analysis, to overcome the traditional limitations of the zero crossing algorithm can not be applied to certain signals, there are MATLAB simulation)
    2014-11-15 11:55:02下载
    积分:1
  • Desktop
    simulink自适应程序s函数和模型,可以用到噪声控制等方向(simulink adaptive program s functions and models, and so can be used to control the direction of the noise)
    2014-12-14 16:13:00下载
    积分:1
  • Gabor-Matlab
    用matlab编写的Gabor滤波器,得虚部和实部(Matlab prepared by the Gabor filter, imaginary part and real part)
    2014-01-19 16:48:02下载
    积分:1
  • fuzzy-control
    一个模糊控制实例,通过模糊控制实现对象的温控制,有程序和文档(An instance of fuzzy control, fuzzy control is realized by controlling the temperature of the object, there are procedures and documentation)
    2014-04-01 16:13:15下载
    积分:1
  • Calling-Matlab
    Before running this example, you should modify your TRNSYS DLL to include Type155 and the required Matlab libraries, as described in the Type155
    2020-10-30 14:49:55下载
    积分:1
  • b18_2neq_1bb
    momic水气两相流,应用LBM BGK模型,模拟了空化泡在近壁区溃灭(momic two phase flow)
    2018-10-02 10:06:06下载
    积分:1
  • 696518资源总数
  • 105901会员总数
  • 40今日下载