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.


  • 相关阅读:
    django之form表单验证
    django之分页器
    django之Ajax
    django之模型层
    django之模板语法
    django之视图函数
    mysql 数据类型
    mysql 命令行查看数据库、创建数据库、选择数据库、删除数据库
    java里的日期时间
    Arrays类
  • 原文地址:https://www.cnblogs.com/xiangshancuizhu/p/2184502.html
Copyright © 2011-2022 走看看