【问题标题】:Matlab: How can I store the output of "fitcecoc" in a databaseMatlab:如何将“fitcecoc”的输出存储在数据库中
【发布时间】:2015-08-29 21:50:10
【问题描述】:

在 Matlab 帮助部分,在“使用 HOG 特征进行数字分类”下有一个非常有用的示例来解决分类问题。您可以通过单击“打开此示例”轻松执行完整的脚本。但是,我想知道是否有办法将“fitcecoc”的输出存储在数据库中,这样您就不必在每次运行代码时都进行训练和分类。这是与我的问题相关的代码部分:

% fitcecoc uses SVM learners and a 'One-vs-One' encoding scheme.
classifier = fitcecoc(trainingFeatures, trainingLabels);

所以,我要做的就是将“分类器”存储在数据库中并检索它以获取以下代码:

predictedLabels = predict(classifier, testFeatures);

【问题讨论】:

    标签: matlab machine-learning computer-vision classification matlab-cvst


    【解决方案1】:

    在 Matlab 中查看Database Toolbox

    您可以将 classifier 变量保存在文件中:

    save('classifier.mat','classifier')
    

    然后在执行predict之前加载它:

    load('classifier.mat')
    predictedLabels = predict(classifier, testFeatures);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-28
      相关资源
      最近更新 更多