| Did you know ... | Search Documentation: |
| Pack logtalk -- logtalk-3.100.1/docs/handbook/_sources/libraries/nmf_projection.rst.txt |
.. _library_nmf_projection:
nmf_projectionThis library implements Non-negative Matrix Factorization (NMF) for continuous datasets whose attribute values are all non-negative. It learns a non-negative basis using deterministic multiplicative updates and represents each transformed instance as a list of non-negative component weights.
Open the `../../apis/library_index.html#nmf_projection <../../apis/library_index.html#nmf_projection>`__ link in a web browser.
To load all entities in this library, load the loader.lgt file:
::
| ?- logtalk_load(nmf_projection(loader)).
To test this library predicates, load the tester.lgt file:
::
| ?- logtalk_load(nmf_projection(tester)).
domain_error(component_count, Requested-Maximum).false. Centering is intentionally disabled because NMF
requires non-negative features.true, each continuous attribute is divided by its maximum
observed training value. When false, raw non-negative values are
used.
Assuming a dataset object parts_based_measurements implementing the
dimension_reduction_dataset_protocol protocol:
::
| ?- nmf_projection::learn(parts_based_measurements, DimensionReducer).
| ?- nmf_projection::learn(parts_based_measurements, DimensionReducer, [n_components(2), feature_scaling(true), maximum_iterations(250), tolerance(1.0e-7)]).
| ?- nmf_projection::learn(parts_based_measurements, DimensionReducer),
nmf_projection::transform(DimensionReducer, [f1-3.0, f2-0.0, f3-1.5, f4-0.0], ReducedInstance).
| ?- nmf_projection::learn(parts_based_measurements, DimensionReducer, [n_components(2)]),
nmf_projection::export_to_file(parts_based_measurements, DimensionReducer, reducer, 'nmf_reducer.pl').
| ?- logtalk_load('nmf_reducer.pl'),
reducer(Reducer),
nmf_projection::transform(Reducer, [f1-3.0, f2-0.0, f3-1.5, f4-0.0], ReducedInstance).
Learned NMF reducers use the representation:
::
nmf_reducer(Encoders, Components, Diagnostics)
where Encoders stores the continuous attribute encoders used to map
instances into a non-negative feature vector, Components stores the
learned non-negative basis vectors, and Diagnostics stores metadata
about the learned reducer.