0

svr の libsvm C# ラッパーを使用して給与を予測しています。予測結果が間違っています。libsvm は、すべてのインスタンスに同じ値を与えています。プリフォーム グリッド検索パラメータを選択しています。この問題を解決するにはどうすればよいですか。コードは次のとおりです。

Problem train = Problem.Read(@"H:\test.csv");
Problem test = Problem.Read(@"H:\testsvmf1.csv");


//For this example (and indeed, many scenarios), the default
//parameters will suffice.
Parameter parameters = new Parameter();
//double C;
//double Gamma;


//This will do a grid optimization to find the best parameters
//and store them in C and Gamma, outputting the entire
//search to params.txt.

ParameterSelection.Grid(train, parameters, @"H:\params.txt", out C, out Gamma);
parameters.C = 512;
parameters.Gamma = 0.5;
parameters.SvmType = SvmType.NU_SVR;
double cv = Training.PerformCrossValidation(train,parameters,10);

Console.Write(cv);
//Train the model using the optimal parameters.

Model model = Training.Train(train, parameters);


//Perform classification on the test data, putting the
//results in results.txt.

Prediction.Predict(test, @"H:\resultsnew1.txt", model, false);

}

public static SvmType NU_SVR { get; set; }
4

1 に答える 1

4

パラメータを調整するためにグリッド検索を実行しているように見えますが、手動で固定値 (C=512、ガンマ=0.5) に設定しています。固定パラメータはトレーニングに使用されます...

于 2013-07-01T06:36:21.717 に答える