predictObjectiveEvaluationTime
一連の点における目的関数の実行回数の予測
説明
例
この例では、最適化された SVM 分類用のベイズ モデルにおける目的関数の評価回数を推定する方法を示します。
最適化された SVM モデルを作成します。このモデルの詳細については、bayesopt を使用した交差検証分類器の最適化を参照してください。
rng default grnpop = mvnrnd([1,0],eye(2),10); redpop = mvnrnd([0,1],eye(2),10); redpts = zeros(100,2); grnpts = redpts; for i = 1:100 grnpts(i,:) = mvnrnd(grnpop(randi(10),:),eye(2)*0.02); redpts(i,:) = mvnrnd(redpop(randi(10),:),eye(2)*0.02); end cdata = [grnpts;redpts]; grp = ones(200,1); grp(101:200) = -1; c = cvpartition(200,'KFold',10); sigma = optimizableVariable('sigma',[1e-5,1e5],'Transform','log'); box = optimizableVariable('box',[1e-5,1e5],'Transform','log'); minfn = @(z)kfoldLoss(fitcsvm(cdata,grp,'CVPartition',c,... 'KernelFunction','rbf','BoxConstraint',z.box,... 'KernelScale',z.sigma)); results = bayesopt(minfn,[sigma,box],'IsObjectiveDeterministic',true,... 'AcquisitionFunctionName','expected-improvement-plus','Verbose',0);


さまざまな点における評価回数を予測します。
sigma = logspace(-5,5,11)'; box = 1e5*ones(size(sigma)); XTable = table(sigma,box); time = predictObjectiveEvaluationTime(results,XTable); [XTable,table(time)]
ans=11×3 table
sigma box time
______ _____ ________
1e-05 1e+05 0.093914
0.0001 1e+05 0.10466
0.001 1e+05 0.090664
0.01 1e+05 0.072101
0.1 1e+05 0.06182
1 1e+05 0.13241
10 1e+05 0.75122
100 1e+05 0.28621
1000 1e+05 0.060051
10000 1e+05 0.066191
1e+05 1e+05 0.066875
入力引数
ベイズ最適化の結果。BayesianOptimization オブジェクトを指定します。
予測点。列数が D のテーブルを指定します。D は、問題に含まれている変数の個数です。これらの点で予測が実行されます。
データ型: table
出力引数
バージョン履歴
R2016b で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)