zoukankan      html  css  js  c++  java
  • SVM调用方法

    网上各种方法搜索:svm的主体都是用标准的c/c++写的,一般给的libSVM的编译在控制台下进行,所以得到的是在类似DoS窗口下运行的程序,使用MFC应该只用做界面部分,把程序主体基本直接搬上去就行!不过如何在MFC中调用外部exe,并能出入参数,这的确是个问题啊,我调试了好久都没成功啊!纠结ing!

    svm-scale.exe用来实现数据缩放归一化,svm-train.exe用来训练数据,生成向量机的model模型,svm-predict.exe用来预测.

    Q: How to build a dynamic library (.dll file) on MS windows? 

    The easiest way is to use Makefile.win. See details in README. Alternatively, you can use Visual C++. Here is the example using Visual Studio .Net 2008:

    1. Create a Win32 empty DLL project and set (in Project->$Project_Name Properties...->Configuration) to "Release." About how to create a new dynamic link library, please refer to http://msdn2.microsoft.com/en-us/library/ms235636(VS.80).aspx
    2. Add svm.cpp, svm.h to your project.
    3. Add __WIN32__ and _CRT_SECURE_NO_DEPRECATE to Preprocessor definitions (in Project->$Project_Name Properties...->C/C++->Preprocessor)
    4. Set Create/Use Precompiled Header to Not Using Precompiled Headers (in Project->$Project_Name Properties...->C/C++->Precompiled Headers)
    5. Set the path for the Modulation Definition File svm.def (in Project->$Project_Name Properties...->Linker->input
    6. Build the DLL.
    7. Rename the dll file to libsvm.dll and move it to the correct path.


  • 相关阅读:
    koa2跨域模块koa2-cors
    使用spring等框架的web程序在Tomcat下的启动顺序及思路理清
    logback 配置解析
    java 学习总结
    如何删除git远程分支
    C++11 锁 lock
    CAS 与 无锁队列
    docker 配置
    vim 中Taglist的安装和使用
    基于C++11的线程池,简洁且可以带任意多的参数
  • 原文地址:https://www.cnblogs.com/xiangshancuizhu/p/2184502.html
Copyright © 2011-2022 走看看