Main Content

compact

クラス: ClassificationDiscriminant

コンパクトな判別分析分類器

構文

cobj = compact(obj)

説明

cobj = compact(obj) は、コンパクトなバージョンの obj を作成します。

入力引数

obj

fitcdiscr を使用して作成された判別分析分類器。

出力引数

cobj

コンパクト分類器。cobj のクラスは CompactClassificationDiscriminant です。obj を使用する場合と同じように、cobj を使用しても正確に分類を予測できます。ただし、cobj には学習データが含まれないため、交差検証などの一部の処理については実行できません。

フィッシャーのアヤメのデータの判別分析分類器とコンパクトなバージョンの分類器のサイズを比較します。

load fisheriris
fullobj = fitcdiscr(meas,species);
cobj = compact(fullobj);
b = whos('fullobj'); % b.bytes = size of fullobj
c = whos('cobj'); % c.bytes = size of cobj
[b.bytes c.bytes] % shows cobj uses 60% of the memory

ans =
       18578       11498