How to get input values for a known output value.

4 ビュー (過去 30 日間)
Saurabh Sharma
Saurabh Sharma 2024 年 1 月 25 日
コメント済み: Saurabh Sharma 2024 年 1 月 26 日
I have trained a Gaussian process regression machine learning model which has six input variables and one output variable. I have 50 observations. So, I have a table of 50*6 for input values and 50*1 for output values. Out of six input variables, three input variables have values between 0.4 to 1 and remaining three input variables have values between 1 to 5. Out of 50 observations, 45 observations are used for learning and remaining 5 observations for prediction. I want to find the values of input variables (within same ranges of 0.4 to 1 and 1 to 5 or different ranges) for a known value of output variable.
X = readmatrix(fullfile(matlabdrive,'an','X.xlsx'),'Range','C1:H45');
Y = readmatrix(fullfile(matlabdrive,'an','Y.xlsx'),'Range','C1:C45');
modell = fitrgp(X,Y,'Basis','linear','FitMethod','exact','PredictMethod','exact');
Xp = readmatrix(fullfile(matlabdrive,'an','Xp.xlsx'),'Range','C1:H5');
Ypl = predict(modell,Xp);
  4 件のコメント
Matt J
Matt J 2024 年 1 月 25 日
So, it doesn't matter ot you that the solution may be non-unique?
Saurabh Sharma
Saurabh Sharma 2024 年 1 月 26 日
Yes.

サインインしてコメントする。

採用された回答

Matt J
Matt J 2024 年 1 月 25 日
One possibility might be to use fmincon to search for a minimum norm solution,
fun=@(Xp) norm(Xp).^2;
nonlcon=@(Xp) deal([],predict(modell,Xp)-Ypl );
lb=[0.4,0.4,0.4,1,1,1];
ub=[1,1,1,5,5,5]
Xp=fmincon(fun,Xp_Initial,[],[],[],[],lb,ub,nonlcon);

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by