什么是 WEKA 中的类索引? [英] What is Class Index in WEKA?

查看:34
本文介绍了什么是 WEKA 中的类索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在我的 java 代码中使用 WEKA 进行预测.基本上我必须研究给定的代码并重用它.

I have to use WEKA in my java code for prediction. Basically I have to study a given code and reuse it.

testdata.setClassIndex(data.numAttributes() - 1);

我无法理解上面这行的意思.什么是类索引?

I am unable to understand what the above line means. What is a Class Index?

testdatadata 是实例对象.

推荐答案

如概述 此处,setClassIndex 用于定义表示类的属性(用于预测目的).鉴于索引从零开始,data.numAttributes() - 1 表示测试数据集的最后一个属性.

As outlined here, setClassIndex is used to define the attribute that will represent the class (for prediction purposes). Given that the index starts at zero, data.numAttributes() - 1 represents the last attribute of the testdata set.

希望这有帮助!

这篇关于什么是 WEKA 中的类索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆