discardResiduals
説明
は、compactCoxMdl
= discardResiduals(coxMdl
)Residuals
プロパティが空のコックス比例ハザード モデルを作成します。多くのデータ点で学習させたモデルでは、残差を削除するとはるかにコンパクトなオブジェクトになります。
例
残差の破棄によるメモリの節約
lightbulb
データ セットからコックス比例ハザード モデルを作成します。このデータ セットの詳細については、2 つのグループの生存時間関数を参照してください。
load('lightbulb.mat'); bulbmodel = fitcox(lightbulb(:,2),lightbulb(:,1),... 'Censoring',lightbulb(:,3));
bulbmodel
で使用されるメモリを調べます。
S1 = whos('bulbmodel');
disp(S1.bytes)
13912
bulbmodel
から残差を削除し、メモリ削減量を調べます。
bulbmodel = discardResiduals(bulbmodel);
S2 = whos('bulbmodel');
disp(S2.bytes/S1.bytes)
0.4986
残差を削除することで、メモリ使用量が約半分に減少しています。
入力引数
出力引数
バージョン履歴
R2022b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)