当前位置: 首页>>代码示例>>Java>>正文


Java ExecutionMonitor.setProgress方法代码示例

本文整理汇总了Java中org.knime.core.node.ExecutionMonitor.setProgress方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionMonitor.setProgress方法的具体用法?Java ExecutionMonitor.setProgress怎么用?Java ExecutionMonitor.setProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.knime.core.node.ExecutionMonitor的用法示例。


在下文中一共展示了ExecutionMonitor.setProgress方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCellFactory

import org.knime.core.node.ExecutionMonitor; //导入方法依赖的package包/类
/**
 * Creates a CellFactory for the class column.
 *
 * @param colName
 *            the name of the class column
 * @return CellFactory for the class column.
 */
private CellFactory createCellFactory(final String colName) {
    return new CellFactory() {

        @Override
        public void setProgress(final int curRowNr, final int rowCount,
                final RowKey lastKey, final ExecutionMonitor exec) {
            exec.setProgress((double) curRowNr / rowCount);
        }

        @Override
        public DataColumnSpec[] getColumnSpecs() {
            return new DataColumnSpec[] {
                    new DataColumnSpecCreator(colName, StringCell.TYPE)
                            .createSpec() };
        }

        @Override
        public DataCell[] getCells(final DataRow row) {
            throw new IllegalStateException(
                    new IllegalAccessException("This shouldn't be called"));
        }
    };
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:31,代码来源:ActiveLearnLoopStartNodeModel.java

示例2: setProgress

import org.knime.core.node.ExecutionMonitor; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void setProgress(final int curRowNr, final int rowCount,
        final RowKey lastKey,
        final ExecutionMonitor exec) {
    exec.setProgress(curRowNr / (double)rowCount, "Processed row "
            + curRowNr + " (\"" + lastKey + "\")");
}
 
开发者ID:pavloff-de,项目名称:spark4knime,代码行数:11,代码来源:JavaSnippetCellFactory.java

示例3: MultiClassKNFST

import org.knime.core.node.ExecutionMonitor; //导入方法依赖的package包/类
public MultiClassKNFST(final KernelCalculator kernel, final String[] labels,
        final ExecutionMonitor progMon) throws Exception {
    super(kernel);
    m_labels = labels;

    final ExecutionMonitor kernelProgMon = progMon.createSubProgress(0.3);
    final ExecutionMonitor nullspaceProgMon =
            progMon.createSubProgress(0.7);
    final RealMatrix kernelMatrix = kernel.kernelize(kernelProgMon);

    // obtain unique class labels
    final ClassWrapper[] classes = ClassWrapper.classes(labels);

    // calculate projection of KNFST
    nullspaceProgMon.setMessage("Calculating nullspace projection");
    m_projection = projection(kernelMatrix, labels);

    nullspaceProgMon.setProgress(1.0,
            "Finished calculating nullspace projection");

    // calculate target points ( = projections of training data into the
    // null space)
    m_targetPoints = MatrixUtils.createRealMatrix(classes.length,
            m_projection.getColumnDimension());
    int n = 0;
    int nOld = 0;
    for (int c = 0; c < classes.length; c++) {
        n += classes[c].getCount();
        m_targetPoints
                .setRowVector(c,
                        MatrixFunctions
                                .columnMeans(kernelMatrix
                                        .getSubMatrix(nOld, n - 1, 0,
                                                kernelMatrix
                                                        .getColumnDimension()
                                                        - 1)
                                .multiply(m_projection)));
        nOld = n;
    }

    // set betweenClassDistances
    m_betweenClassDistances =
            MatrixFunctions.calculateRowVectorDistances(m_targetPoints);

}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:46,代码来源:MultiClassKNFST.java

示例4: OneClassKNFST

import org.knime.core.node.ExecutionMonitor; //导入方法依赖的package包/类
public OneClassKNFST(final KernelCalculator kernel,
        final ExecutionMonitor progMon) throws Exception {
    super(kernel);

    final ExecutionMonitor kernelProgMon = progMon.createSubProgress(0.3);
    final ExecutionMonitor nullspaceProgMon =
            progMon.createSubProgress(0.7);

    // get number of training samples
    final RealMatrix kernelMatrix = m_kernel.kernelize(kernelProgMon);
    final int n = kernelMatrix.getRowDimension();

    // include dot products of training samples and the origin in feature
    // space (these dot products are always zero!)
    final RealMatrix k = MatrixFunctions.concatVertically(
            MatrixFunctions.concatHorizontally(kernelMatrix,
                    MatrixUtils.createRealMatrix(
                            kernelMatrix.getRowDimension(), 1)),
            MatrixUtils.createRealMatrix(1,
                    kernelMatrix.getColumnDimension() + 1));

    // create one-class labels + a different label for the origin
    final String[] labels = new String[n + 1];
    for (int l = 0; l <= n; l++) {
        labels[l] = (l == n) ? "0" : "1";
    }

    // get model parameters
    nullspaceProgMon.setMessage("Calculating nullspace projection");
    final RealMatrix projection = projection(k, labels);
    nullspaceProgMon.setProgress(1.0,
            "Finished calculating nullspace projection");
    final int[] indices = new int[n];
    for (int i = 0; i < n; i++) {
        indices[i] = i;
    }
    m_targetPoints =
            MatrixUtils
                    .createRowRealMatrix(
                            MatrixFunctions
                                    .columnMeans(k
                                            .getSubMatrix(0, n - 1, 0,
                                                    k.getColumnDimension()
                                                            - 1)
                                    .multiply(projection)).toArray());
    m_projection = projection.getSubMatrix(0, n - 1, 0,
            projection.getColumnDimension() - 1);
    m_betweenClassDistances =
            new double[] { Math.abs(m_targetPoints.getEntry(0, 0)) };
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:51,代码来源:OneClassKNFST.java


注:本文中的org.knime.core.node.ExecutionMonitor.setProgress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。