- Mean
- Median
- Sum
- Maximum or Minimum
- Standard deviation
how to make vector as response value using gaussian process regression?
4 次查看(过去 30 天)
显示 更早的评论
I want to predict 'Vertices' coulmn with fitrgp(gaussian process regression).
gprMdl = fitrgp(a,'Vertices','KernelFunction','ardsquaredexponential',...
'FitMethod','sr','PredictMethod','fic','Standardize',1)
the error occured saying that Invalid datatype. Response variable must be double vector or single vector.
Please let me know how to solve this problem.
Thanks.
0 个评论
回答(1 个)
Harimurali
2023-9-15
Hi Sierra,
I understand that you want to use the first column, that is, the ‘vertices’ column from the table, which is of the type of cell array, as the response variable for Gaussian Process Regression.
In this case, when you are using the “fitrgp” function, it is required that the response variable be a double vector or single vector. Gaussian process regression in MATLAB assumes a single response variable for each observation.
The column could be converted into a double vector and used as a response variable. To achieve this, you can use a method known as "aggregation" or "summary statistics". This entails using a selected measure or summary statistic to summarize the vector entries into a single value.
Here are a few common metrics you can consider:
Here's an example of how you can convert the column into a double vector using the mean as the summary statistic:
c = cell2table({[1,2,4], 2, 4;[2, 3], 3, 5; [10, 20, 5,6], 15, 6});
c.Var1 = cellfun(@mean, c{:, 1});
gprMdl = fitrgp(c, 'Var1', 'KernelFunction','ardsquaredexponential',...
'FitMethod','sr','PredictMethod','fic','Standardize',1);
Please refer to the following documentation for more information on ‘responseVarName’ parameter of the “fitrgrgp” function:
You may also refer to the help documentation for the "fitrgp" function in MATLAB using the following command:
help fitrgp
Hope this helps to resolve the error.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!