other parameters

Open
#360 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
java

Research direction

Start with wayang-commons/wayang-basic/src/main/java/org/apache/wayang/basic/operators/KMeansOperator.java and review the TODOs for additional parameters, fit/transform support, and cardinality estimation. The issue does not specify which parameters or behavior are required, so clarify the intended KMeans API and acceptance criteria before implementation.

Written by the indexing model from the issue text.

Description

todo

other parameters

https://github.com/apache/incubator-wayang/blob/897797899866f373f93e5672b36d5e34611faece/wayang-commons/wayang-basic/src/main/java/org/apache/wayang/basic/operators/KMeansOperator.java#L30


/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.wayang.basic.operators;

import org.apache.wayang.basic.data.Tuple2;
import org.apache.wayang.core.api.Configuration;
import org.apache.wayang.core.optimizer.cardinality.CardinalityEstimator;
import org.apache.wayang.core.plan.wayangplan.UnaryToUnaryOperator;
import org.apache.wayang.core.types.DataSetType;

import java.util.Optional;

public class KMeansOperator extends UnaryToUnaryOperator<double[], Tuple2<double[], Integer>> {
    // TODO other parameters
    protected int k;

    public KMeansOperator(int k) {
        super(DataSetType.createDefaultUnchecked(double[].class),
                DataSetType.createDefaultUnchecked(Tuple2.class),
                false);
        this.k = k;
    }

    public KMeansOperator(KMeansOperator that) {
        super(that);
        this.k = that.k;
    }

    public int getK() {
        return k;
    }

    // TODO support fit and transform

    @Override
    public Optional<CardinalityEstimator> createCardinalityEstimator(int outputIndex, Configuration configuration) {
        // TODO
        return super.createCardinalityEstimator(outputIndex, configuration);
    }
}

5f597cd5aef6e34f7ecdbfad76fb780d46d41a09

Dominant language
Java
Stars
284
Forks
147
Avg merge
2d 13h
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/wayang

All issues in apache/wayang

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.