MATLAB: How to fix Errors when predicting values in trained LSBoost model

categorical variablesMATLABpredicting values in trained lsboost regression model.

Hello friends, I am totally new to Matlab. I built a LSBoost Model in regression Lerner and imported it to Matlab. I wanted to test the model by inputing the value to predict the outcome. The model has 80 variables, 2 of which are Categorical (HoursEnding and Month). Below are my two lines of codes and bunch of error messages I am getting as a result. Guys please help me out with understanding the missing pieces and hot solve them. Much appreciate it.
My codes after importing trainedMidel into Matlab. Forecast.xlsx are where my predicting values are stored to solve for Y.
T = readtable("Forecast.xlsx");
yfit = trainedModel.predictFcn(T)
There are the errors I am getting as results. It appears that 2 of my categorical variables (HoursEnding and Month) need to be properly declaired. I just don't know how to.
Error using classreg.learning.internal.table2PredictMatrix>makeXMatrix (line 96)
Table variable HoursEnding is not a valid predictor.
Error in classreg.learning.internal.table2PredictMatrix (line 47)
Xout = makeXMatrix(X,CategoricalPredictors,vrange,pnames);
Error in classreg.learning.regr.RegressionModel/predict (line 169)
X = classreg.learning.internal.table2PredictMatrix(X,[],[],…
Error in classreg.learning.regr.CompactRegressionEnsemble/predict (line 95)
yfit = predict@classreg.learning.regr.RegressionModel(this,X,varargin{:});
Error in mlearnapp.internal.model.coremodel.TrainedRegressionEnsemble>@(x)predict(RegressionEnsemble,x) (line 50)
functionHandle = @(x) predict(RegressionEnsemble, x);
Error in mlearnapp.internal.model.transformation.TrainedManualFeatureSelection>@(x)decoratedPredictFunction(featureSelectionFunction(x)) (line 66)
functionHandle = @(x) decoratedPredictFunction(featureSelectionFunction(x));
Error in mlearnapp.internal.model.DatasetSpecification>@(x)exportableModel.predictFcn(predictorExtractionFcn(x)) (line 166)
newExportableModel.predictFcn = @(x) exportableModel.predictFcn(predictorExtractionFcn(x));

Best Answer

T = readtable("Forecast.xlsx");
T.HoursEnding = categorical(T.HoursEnding);
T.Month = categorical(T.Month);
yfit = trainedModel.predictFcn(T)