-1

大規模なデータ行列を扱うプロジェクトに取り組んでいます。計算のために正規化しようとすると、エラーが発生します

operator - is undefined for argument types double[]

私のコードは次のとおりです。

import Jama.*;

public static Matrix normalize(Matrix ip_matrix, double[][] min_bound, double[][] max_bound)
{
    Matrix mat = ip_matrix.transpose();
    double[][] mat1 = mat.getArray(); // getting matrix as an array to perfom the computation.
    int nb_input = mat1[0].length;
    double[][] norm = new double[mat1[0].length][mat1[1].length]; // Initialize a default array to store the output, in the required dimension.

    for (int i = 0; i <= nb_input; i++)
    {
        norm[i] = (mat1[i] - min_bound[i] / (max_bound[i] - min_bound[i])); //The line where i get the error.

    }
    norm = norm.getMatrix();
    return norm;
    }

私は基本的に python プログラマーであり、同じロジックが python コードで正常に機能します。Pythonでnumpyを使用しています。同じためにJavaでJAMAライブラリを使用しています。

私はJavaの初心者なので、どんなガイダンスでも高く評価してください。

4

1 に答える 1