%% Fit LSA Model to Word Count Matrix
% Load the example data. sonnetsCounts.mat contains a matrix of word counts corresponding to preprocessed versions of Shakespeare's sonnets.

load sonnetsCounts.mat
size(counts)

% Fit LSA model with 20 components. Set the feature strength exponent to 4.

numComponents = 20;
exponent = 4;
mdl = fitlsa(counts,numComponents, ...
    'FeatureStrengthExponent',exponent)

% Copyright 2012 The MathWorks, Inc.