资源简介
非常有戏的机器学习课程设计《基于朴素贝叶斯方法的fMRI数据分析》。压缩包内附有课程设计原文,word版本。同时,附有实验用全部程序,由数十个matlab函数组成。所以,也是学习matlab和朴素贝叶斯的好资料!数据集相信可以从网站下载,也可以向本人索要。

代码片段和文件信息
% applyClassifier(examplesclassifier)
%
% Apply a learnt classifier (from trainClassifier) to the new examples and
% get the scores for classification.
%
% This function outputs a matrix of scores of the labelling over all the
% classes present in the test set. The columns of that matrix
% correspond to the labels sorted in increasing order of their
% numeric values
% (e.g. columns 1-6 would be labels 2-7 in the sixcategories study
% which has 6 classes)
%
% The specific scoring measure will depend on the classifier used
% see classifier code for details
%
% Input:
% - examples a matrix of real numbers with dimenstion of #examples*#features
% - classifier (learnt by trainClassifier)
%
% Output:
% - score a matrix of real number with dimension of #examples*#classes
% Each row contains [score(1st class|data) ... score(kth class|data)]
%
% Dependencies:
% - serious dependence on the “classifier“ format produced by trainClassifier.
%
% Example:
% - [predictions] = applyClassifier(examplesclassifier);
%
% History:
% - Oct072005 Wei - redocument
% - 10 Mar 05 - fpereira - adapted from previous code
function [scores] = applyClassifier( varargin )
%
% Process parameters
%
l = length(varargin);
if l < 2; help applyClassifier; return; end;
examples = varargin{1};
trainedClassifier = varargin{2};
classifierType = trainedClassifier.classifier;
classifierParams = trainedClassifier.classifierParameters;
models = trainedClassifier.models;
lastpos = size(models1);%返回5
trainingSetInfo = trainedClassifier.trainingSetInfo;
sortedLabelValues = trainingSetInfo.sortedLabelValues;% 12
nClasses = length(sortedLabelValues);
nFeatures = size(examples2);
nExamples = size(examples1);
% This matrix will keep the prediction scores and feature relevance values
% corresponding to each example
% - scores is a #examples*#classes matrix
% (each line is scores for one example in label value order)
% - cFeatureContribution is a cell array where each cell contains
% a featureContribution map for a class
% A featureContribution map is a #examples*#features matrix
scores = zeros(nExamplesnClasses);
cFeatureContribution = cell(nClasses1);
cFeatureLogProbs = cell(nClasses1);
%
%下面是针对不同类型的方法,执行的函数体,贝叶斯的只是很小一部分
% run the classifier - eventually we will encapsulate this and
% the code for different kinds of classifier for now a large switch statement
trainingSetInfo = models{nClasses+2};%和上面的赋值内容一样
priors = trainingSetInfo.classPriors;%先验概率
switch classifierType
%
% Logistic regression
%
case {‘logisticRegression2‘}
% discriminative model weights;
W = models{nClasses+1};
tmp = models{nClasses+3}{1}; % parameters used to train此时是空的
transform = tmp{3}; lambda = tmp{2}; eta = tmp{1};
switch transform
case {‘none‘}
% vanilla logistic regression
tmp = exp([ones(nExamples1)examples] * W);
scores = tmp ./ r
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 460338 2012-07-18 22:11 《机器学习》课程设计论文.doc
文件 19258 2010-03-05 22:21 程序\applyClassifier.m
文件 16513 2010-03-03 22:45 程序\classifierBayes.m
文件 874 2005-10-13 20:17 程序\computeCorrelation.m
文件 2777 2010-03-04 17:01 程序\idmToExamples_condLabel.m
文件 1059 2005-10-13 20:17 程序\mergeExamples.m
文件 3537 2005-10-13 20:17 程序\mri_mergeIDM.m
文件 9123 2010-03-05 11:17 程序\summarizePredictions.m
文件 2244 2010-03-10 03:44 程序\TestROI.m
文件 9718 2010-03-04 00:01 程序\trainClassifier.m
文件 2129 2005-10-13 20:17 程序\transformIDM_avgROIVoxels.m
文件 3115 2005-10-13 20:17 程序\transformIDM_avgVoxels.m
文件 5810 2005-10-13 20:17 程序\transformIDM_selectActiveVoxact.m
文件 1195 2005-10-13 20:17 程序\transformIDM_selectROIVoxels.m
文件 840 2005-10-13 20:17 程序\transformIDM_selectTimewindow.m
文件 968 2005-10-13 20:17 程序\transformIDM_selectTrials.m
文件 8765 2005-10-13 20:17 程序\transformIDM_smoothingKR.m
目录 0 2012-07-18 22:12 程序
----------- --------- ---------- ----- ----
548263 18
相关资源
- 激光谐振腔课程设计(matlab)exe及源
- 语音信号的采集与处理课程设计
- 自动控制原理课程设计2019.rar
- MATLAB课程设计水果识别项目
- 基于贝叶斯决策的分类
- 贝叶斯分类器Matlab实现113478
- zw_支持向量机与朴素贝叶斯算法matl
- QR法求解特征值特征向量(MATLAB)课程
- svm支持向量机与nbc朴素贝叶斯算法比
- 基于MATLAB的柑橘果实分类图像朴素贝
- 5V反激电源的课程设计
- 用身高和/或体重数据进行性别分类的
- 数字图像课程设计MATLAB实现简单找茬
- 斯坦福机器学习编程作业machine-learn
- matlab结课大作业人脸识别是否戴口罩
- MATLAB与机器学习
- EM算法--基于贝叶斯
- MACHINE_LEARNING_with_NEURAL_NETWORKS_using_MA
- 数字与图像处理matlab课程设计
- 贝叶斯网络Matlab源代码
- 贝叶斯网络工具箱MATLAB工具箱
- 贝叶斯压缩感知matlab源代码
- FM调制与解调的课程设计
- 电力系统潮流计算MATLAB课程设计
- 交替方向乘子法ADMM算法的matlab代码
- 基于Matlab的数字图像处理课程设计
- 基于MATLAB的图像处理的课程设计论文
- 机器学习 : 实用案例解析 mobi格式
-
直流调速系统的Matlab/Simuli
nk仿真 - 模式识别4个实验(matlab)
评论
共有 条评论