如何在weka中使用libsvm

时间:2014-11-19 03:48:06

标签: java weka svm libsvm

我无法在weka中使用lib svm。

我已经按照这里的步骤进行了大量谷歌搜索,但无济于事。

How to use LibSVM with Weka in my Java code?

我只需要这段代码

LibSVM classifier = new LibSVM()

上班。

但是它一直无法检测到LibSVM库

enter image description here

我做错了什么?

我无法得到罐子

您可以从此处获取wlsvm.jar:http://www.cs.iastate.edu/~yasser/wlsvm/

从此处解决方案中提出。

无论如何,我可以使用GUI将LIBSVM安装到weka中,然后将jar解压出来吗?

3 个答案:

答案 0 :(得分:1)

我通过下载并将其添加到我的库来解决了这个问题。

http://mvnrepository.com/artifact/nz.ac.waikato.cms.weka/LibSVM/1.0.6

答案 1 :(得分:1)

下载LIBSVM库并添加其路径。现在打开weka,添加数据集,转到分类,转到函数,然后选择LIbSVM。 为了提高准确性,您可以使用交叉验证。

答案 2 :(得分:0)

以下步骤描述了如何在Weka GUI中使用libsvm。

import { Injectable } from '@angular/core';

@Injectable()
export class HeightService {

  lastHeightPosted = null;
  constructor() { }

  public resize() {
    console.log('resizing');

    var body = document.body,
        html = document.documentElement;

    var height = Math.max( 
      body.scrollHeight, 
      body.offsetHeight, 
      body.clientHeight, 
      html.offsetHeight
    );

    if ( lastHeightPosted !== height) {
        parent.postMessage(height, '*');
        lastHeightPosted = height;
    }
  }

  ngAfterViewChecked() {
     this._heightService.resize();
  }
}