IZEL_set_y_test
テスト用データの教師ラベルをセットします。
void IZEL_set_y_test(int handle, unsigned int y)
引数
引数名 | I/O | 説明 |
---|---|---|
handle | In | ハンドラ値 |
y | In | 教師ラベルを渡します。 教師ラベルは1から始まる連続した整数です。IZEL_set_output_layer()の引数 length に指定した範囲の値が許容されます。 例えば length が 3 の場合は、y に許容される値は 1, 2, 3 のいずれかとなります。それ以外の値が渡された場合はエラーとなります。 |
戻り値
0 : 正常
-1: エラー
サンプルソース
#include <Izel.mqh>
void sample()
{
int handle;
// オープン
handle = IZEL_open();
if( handle < 0 ) {
// エラー処理;
}
// 学習モデルの定義
IZEL_add_layer(handle, 100);
IZEL_add_layer(handle, 200);
IZEL_set_output_layer(handle, 2);
// トレーニングデータのセット
IZEL_open_x_train(handle);
IZEL_append_x_train(handle, 1.0);
IZEL_append_x_train(handle, 2.0);
IZEL_close_x_train(handle);
IZEL_set_y_train(handle, 1);
/*
データのセットを繰り返す。
・
・
・
*/
// トレーニング
IZEL_fit(handle, 100, 32);
// トレーニングデータのセット
IZEL_open_x_test(handle);
IZEL_append_x_test(handle, 1.0);
IZEL_append_x_test(handle, 2.0);
IZEL_close_x_test(handle);
IZEL_set_y_test(handle, 2);
/*
データのセットを繰り返す。
・
・
・
*/
IZEL_test(handle);
// クローズ
IZEL_close(handle);
}