How to predict each pixel of image using regression model?

9 ビュー (過去 30 日間)
Zoe
Zoe 2017 年 7 月 7 日
コメント済み: Philku Lee 2021 年 6 月 28 日
I have the following code that loops over each pixel of a .tif image to predict responses using ensemble of regression models.
X is a 753*6 numeric array which has 6 variables (also columns), and 753 rows. NR = 1380, NC = 1464.
I understand the error's meaning (The dimensions on both sides do not match each other), but I really do not know how to fix it. I imagine the result I need should be a 1380*1464 numeric array.
a = imread('LE71250521999276_b1.tif')
[NR,NC] = size(a);
Yfit = zeros(NR,NC);
for i = 1:NR
for j = 1:NC
Yfit(i,j) = predict(Mdl1999276,X);
end
end
ERROR: Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Thank you for helping!!
  1 件のコメント
donald adams
donald adams 2017 年 11 月 21 日
Your Mdl11999276 variable is undefined

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

採用された回答

Walter Roberson
Walter Roberson 2017 年 7 月 7 日
Why are you using all of X to do the prediction each time?
Why are you reading in the image if you are not going to predict based on its values?
Ensembles often make one prediction per ensemble member per sample; if so then you might need to analyze a vector of results to decide what one output you want.
Predictions sometimes output a probability per class rather than a single class number.
  5 件のコメント
Noor Abbas
Noor Abbas 2018 年 3 月 19 日
Does any paper or research that relevant with predict number of pixel using machine learning, Best Regards,
Philku Lee
Philku Lee 2021 年 6 月 28 日
It might be related to
https://www.sciencedirect.com/science/article/pii/S0016236121003203

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSupport Vector Machine Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by