CompactRegressionChainEnsemble
Description
CompactRegressionChainEnsemble
is a compact version of a RegressionChainEnsemble
model object. The compact model does not include the data
used for training the model.
Creation
Create a full RegressionChainEnsemble
object and then compact it by using the compact
object
function.
Properties
Chain Ensemble Properties
This property is read-only.
Order of the response variables in the regression chains, specified as a positive integer matrix. Row i indicates the order of the response variables in regression chain i.
Data Types: double
This property is read-only.
Compact regression models trained as part of the regression chains, specified as a cell array
of regression model objects. Each row of Learners
corresponds to
one regression chain.
This table lists the possible compact regression models.
Regression Model Type | Model Object |
---|---|
Bagged or boosted ensemble of trees | CompactRegressionEnsemble |
General additive model (GAM) | CompactRegressionGAM |
Gaussian process regression (GPR) | CompactRegressionGP |
Kernel model | RegressionKernel |
Linear model | RegressionLinear |
Support vector machine (SVM) | CompactRegressionSVM |
Decision tree | CompactRegressionTree |
Data Types: cell
This property is read-only.
Number of regression chains in the chain ensemble, specified as a positive integer scalar.
NumChains
indicates the number of rows in
ChainOrders
and Learners
.
Data Types: double
Data Properties
This property is read-only.
Categorical predictor indices, specified as a positive integer vector. Each index value in CategoricalPredictors
indicates that the corresponding predictor listed in PredictorNames
is categorical. If none of the predictors are categorical, then this property is empty ([]
).
Data Types: double
This property is read-only.
Number of predictor variables, specified as a positive integer scalar.
NumPredictors
does not include response variables that are used
as predictors by some models in Learners
.
To see all the predictors used by a specific compact regression model in
Learners
, use the properties of the compact regression model.
For an example, see Specify Multiresponse Regression Model Properties.
Data Types: double
This property is read-only.
Number of response variables, specified as a positive integer scalar.
Data Types: double
This property is read-only.
Predictor variable names, specified as a cell array of character vectors. The order of the
elements in PredictorNames
corresponds to the order of the
predictors in the data used to train the model.
Data Types: cell
This property is read-only.
Response variable names, specified as a string array. The order of the elements in
ResponseName
corresponds to the order of the response variables
in the data used to train the model.
Data Types: string
Object Functions
Examples
Reduce the size of a full multiresponse regression model by removing the training data from the model. You can use a compact model to improve memory efficiency.
Load the carbig
data set, which contains measurements of cars made in the 1970s and early 1980s. Create a table containing the predictor variables Displacement
, Horsepower
, and so on, as well as the response variables Acceleration
and MPG
. Display the first eight rows of the table.
load carbig cars = table(Displacement,Horsepower,Model_Year, ... Origin,Weight,Acceleration,MPG); head(cars)
Displacement Horsepower Model_Year Origin Weight Acceleration MPG ____________ __________ __________ _______ ______ ____________ ___ 307 130 70 USA 3504 12 18 350 165 70 USA 3693 11.5 15 318 150 70 USA 3436 11 18 304 150 70 USA 3433 12 16 302 140 70 USA 3449 10.5 17 429 198 70 USA 4341 10 15 454 220 70 USA 4354 9 14 440 215 70 USA 4312 8.5 14
Categorize the cars based on whether they were made in the USA.
cars.Origin = categorical(cellstr(cars.Origin)); cars.Origin = mergecats(cars.Origin,["France","Japan",... "Germany","Sweden","Italy","England"],"NotUSA");
Remove observations with missing values.
cars = rmmissing(cars);
Train a multiresponse regression model by passing the cars
data to the fitrchains
function. Use regression chains composed of regression SVM models with standardized numeric predictors.
Mdl = fitrchains(cars,["Acceleration","MPG"], ... Learner=templateSVM(Standardize=true))
Mdl = RegressionChainEnsemble PredictorNames: {'Displacement' 'Horsepower' 'Model_Year' 'Origin' 'Weight'} ResponseName: ["Acceleration" "MPG"] CategoricalPredictors: 4 NumChains: 2 LearnedChains: {2×2 cell} NumObservations: 392 Properties, Methods
Mdl
is a trained RegressionChainEnsemble
model object. The model contains information about the training data set, such as the training data properties X
and Y
.
Reduce the size of the model by using the compact
object function.
compactMdl = compact(Mdl)
compactMdl = CompactRegressionChainEnsemble PredictorNames: {'Displacement' 'Horsepower' 'Model_Year' 'Origin' 'Weight'} ResponseName: ["Acceleration" "MPG"] CategoricalPredictors: 4 NumChains: 2 LearnedChains: {2×2 cell} Properties, Methods
compactMdl
is a CompactRegressionChainEnsemble
model object. compactMdl
contains fewer properties than the full model Mdl
.
Display the amount of memory used by each model.
whos("Mdl","compactMdl")
Name Size Bytes Class Attributes Mdl 1x1 125951 RegressionChainEnsemble compactMdl 1x1 95825 classreg.learning.regr.CompactRegressionChainEnsemble
The full model is larger than the compact model.
Version History
Introduced in R2024b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)