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.25999
0.0001 1e+05 0.27678
0.001 1e+05 0.24152
0.01 1e+05 0.23432
0.1 1e+05 0.18991
1 1e+05 0.32159
10 1e+05 1.2852
100 1e+05 0.46865
1000 1e+05 0.17883
10000 1e+05 0.28235
1e+05 1e+05 0.23559
入力引数
results
— ベイズ最適化の結果
BayesianOptimization
オブジェクト
ベイズ最適化の結果。BayesianOptimization
オブジェクトを指定します。
XTable
— 予測点
列数が D のテーブル
予測点。列数が D のテーブルを指定します。D は、問題に含まれている変数の個数です。これらの点で予測が実行されます。
データ型: table
出力引数
バージョン履歴
R2016b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)