小编use*_*939的帖子

Mahout - 简单的分类问题

我正在尝试构建一个简单的模型,可以将点分类为 2D空间的2个分区:

  1. 我通过指定几个点和它们所属的分区训练模型.
  2. 我使用该模型来预测组(分类),其中,测试点可能落在.

不幸的是,我没有得到预期的答案.我在代码中遗漏了什么,或者我做错了什么?

public class SimpleClassifier {

    public static class Point{
        public int x;
        public int y;

        public Point(int x,int y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object arg0) {
            Point p = (Point)  arg0;
            return( (this.x == p.x) &&(this.y== p.y));
        }

        @Override
        public String toString() {
            // TODO Auto-generated method stub
            return  this.x + " , " + this.y ; 
        }
    } …
Run Code Online (Sandbox Code Playgroud)

java classification mahout

4
推荐指数
1
解决办法
755
查看次数

标签 统计

classification ×1

java ×1

mahout ×1