资源简介
非常有戏的机器学习课程设计《基于朴素贝叶斯方法的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
相关资源
- usps手写数字数据集
- cifar-10 数据集 MATLAB版本
- 扬州大学MATLAB课程课程设计报告含程
- Matlab基于贝叶斯,朴素贝叶斯,最小
- 斯坦福大学CS229机器学习完整详细笔记
- MATLAB神经网络43个案例分析源码
- MATLAB贝叶斯网络工具箱FullBNT-1.0.7
- MATLAB神经网络30个案例分析全书+源代
- 贝叶斯抠图算法matlab实现
- 斯坦福机器学习公开课CS229讲义作业及
- Matlab课程设计:对作业文档格式化批
- MATLAB车牌识别课程设计源码(带界面
- 机器学习基础,配套代码
- 机器学习:近20种人工神经网络模型m
- 六轴机器人课程设计 全套matlab程序,
- 机器学及其matlab实现—从基础到实践
- mnist的mat格式数据
- 《MATLAB神经网络43个案例分析》源代码
- matlab贝叶斯网络工具箱
- 机器学习基础教程 matlab代码+数据
- 贝叶斯抠图.zip
- MATLAB神经网络原理与精解pdf+源码
- 数值分析课程设计.docx
- 课程设计:基于MATLAB的语音信号分析
- 吴恩达机器学习MATLAB/Octave超详细超完
- 视觉机器学习20讲(照片版PDF和matla
- 基于 MATLAB 的语音信号分析与处理的课
- kuaisu稀疏贝叶斯
- 稀疏贝叶斯模型相关向量机
- 贝叶斯分类作业题 matlab
评论
共有 条评论