//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** @author John Miller * @version 1.6 * @date Mon Sep 2 16:24:38 EDT 2013 * @see LICENSE (MIT style license file). * * @title Data Reduction: Base Trait for Dimensionality Reducers */ package scalation.analytics import scalation.linalgebra.MatriD //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** The `Reducer` trait provides a common framework for several data reduction * algorithms. */ trait Reducer { //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Reduce the original data matrix by producing a lower dimensionality matrix * that maintains most of the descriptive power of the original matrix. */ def reduce (): MatriD //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Reduce the original data matrix by factoring it into two lower dimensionality * matrices that maintains most of the descriptive power of the original matrix. * Override to algorithms that use factoring. * @see `NMFactortorization` */ def factorReduce (): (MatriD, MatriD) = (reduce (), null) //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Approximately recover the original matrix. The new matrix will have * the same dimensionality, but will have some lose of information. */ def recover (): MatriD } // Reducer trait