% Note: You can either set WEKA_HOME as an environment variable or pass
% absolute path of weka.jar to javaaddpath. For example,
% javaaddpath('c:\weka\bin\weka.jar');
javaaddpath('WEKA_HOME/weka.jar');
clear all
clc
import weka.classifiers.Classifier
import weka.classifiers.bayes.BayesNet
import weka.classifiers.Evaluation;
% calling classifier from matlab
v1 = java.lang.String('-t');
%v2 = java.lang.String('D:\Shoaib\BioMANTA\bioManta code\classification\loc_nlboost\bn\loc_trDt.csv');
v2 = java.lang.String('WEKA_HOME\trainData.arff');
v3 = java.lang.String('-T');
v4 = java.lang.String('WEKA_HOME\testDATA.arff');
prm = cat(1,v1,v2,v3,v4);
Evaluation.evaluateModel(javaObject('weka.classifiers.bayes.BayesNet'),prm);
1条答案
按热度按时间oxcyiej71#
您可以通过导入weka.jar在MATLAB中使用Weka。下面是一个小的.m文件脚本,演示如何在MATLAB中使用Weka的贝叶斯网络,由Muhammad Shoaib Sehgal编写。