SparseFiltering
Feature extraction by sparse filtering
Description
SparseFiltering
uses sparse filtering to
learn a transformation that maps input predictors to new predictors.
Creation
Create a SparseFiltering
object using the sparsefilt
function.
Properties
This property is read-only.
Fitting history, returned as a structure with two fields:
Iteration
— Iteration numbers from 0 through the final iteration.Objective
— Objective function value at each corresponding iteration. Iteration 0 corresponds to the initial values, before any fitting.
Data Types: struct
This property is read-only.
Initial feature transformation weights, returned as a
p
-by-q
matrix, where p
is the number of predictors passed in X
and
q
is the number of features that you want. These weights are the
initial weights passed to the creation function. The data type is single when the
training data X
is single.
Data Types: single
| double
This property is read-only.
Parameters used for training the model, returned as a structure. The
structure contains a subset of the fields that corresponds to the sparsefilt
name-value pairs
that were in effect during model creation:
IterationLimit
VerbosityLevel
Lambda
Standardize
GradientTolerance
StepTolerance
For details, see the sparsefilt
name-value pairs in
the documentation.
Data Types: struct
This property is read-only.
Predictor means when standardizing, returned as a
p
-by-1
vector. This property is nonempty when
the Standardize
name-value pair is
true
at model creation. The value is the vector of predictor
means in the training data. The data type is single when the training data
X
is single.
Data Types: single
| double
This property is read-only.
Number of output features, returned as a positive integer. This value is
the q
argument passed to
the creation function, which is the requested number of features to
learn.
Data Types: double
This property is read-only.
Number of input predictors, returned as a positive integer. This value is
the number of predictors passed in X
to the creation
function.
Data Types: double
This property is read-only.
Predictor standard deviations when standardizing, returned as a
p
-by-1
vector. This property is nonempty when
the Standardize
name-value pair is
true
at model creation. The value is the vector of predictor
standard deviations in the training data. The data type is single when the training data
X
is single.
Data Types: single
| double
This property is read-only.
Feature transformation weights, returned as a
p
-by-q
matrix, where p
is the number of predictors passed in X
and
q
is the number of features that you want. The data type is
single when the training data X
is single.
Data Types: single
| double
Object Functions
transform | Transform predictors into extracted features |
Examples
Create a SparseFiltering
object by using the sparsefilt
function.
Load the SampleImagePatches
image patches.
data = load('SampleImagePatches');
size(data.X)
ans = 1×2
5000 363
There are 5,000 image patches, each containing 363 features.
Extract 100 features from the data.
rng default % For reproducibility Q = 100; obj = sparsefilt(data.X,Q,'IterationLimit',100)
Warning: Solver LBFGS was not able to converge to a solution.
obj = SparseFiltering ModelParameters: [1×1 struct] NumPredictors: 363 NumLearnedFeatures: 100 Mu: [] Sigma: [] FitInfo: [1×1 struct] TransformWeights: [363×100 double] InitialTransformWeights: [] Properties, Methods
sparsefilt
issues a warning because it stopped due to reaching the iteration limit, instead of reaching a step-size limit or a gradient-size limit. You can still use the learned features in the returned object by calling the transform
function.
Version History
Introduced in R2017a
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)