<commit_before>/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Written (W) 2011 <NAME>
 * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
 */

#ifndef CLASSICMDS_H_
#define CLASSICMDS_H_
#ifdef HAVE_LAPACK
#include "preprocessor/DimensionReductionPreprocessor.h"
#include "features/Features.h"
#include "distance/Distance.h"

namespace shogun
{

class CFeatures;
#include "preprocessor/DimensionReductionPreprocessor.h"
class CDistance;

/** @brief the class ClassicMDS used to perform classic eigenvector
 * 	multidimensional scaling.
 *
 * 	Description is given at p.261 (Section 12.1) of
 * 	<NAME>., & <NAME>. (2005).
 * 	Modern multidimensional scaling: Theory and applications. Springer.
 *
 */
class CClassicMDS: public CDimensionReductionPreprocessor
{
public:

	/* constructor */
	CClassicMDS();

	/* destructor */
	virtual ~CClassicMDS();

	/** init
	 * @param data feature vectors for preproc
	 */
	virtual bool init(CFeatures* features);

	/** cleanup
	 *
	 */
	virtual void cleanup();

	/** apply preproc to distance
	 *
	 */
	virtual CSimpleFeatures<float64_t>* apply_to_distance(CDistance* distance);

	/** apply preproc to feature matrix
	 *
	 */
	virtual SGMatrix<float64_t> apply_to_feature_matrix(CFeatures* features);

	/** apply preproc to feature vector
	 *
	 */
	virtual SGVector<float64_t> apply_to_feature_vector(SGVector<float64_t> vector);

	/** get name */
	virtual inline const char* get_name() const { return "CLASSICMDS"; };

	/** get type */
	virtual inline EPreprocessorType get_type() const { return P_CLASSICMDS; };

protected:

	/** positive eigenvalues of last call in descending order */
	SGVector<float64_t> m_eigenvalues;

	/** apply preproc to distance
	 *
	 */
	SGMatrix<float64_t> embed_by_distance(CDistance* distance);

};

}

#endif /* HAVE_LAPACK */
#endif /* CLASSICMDS_H_ */<commit_msg>Added getter for eigenvalues of ClassicMDS<commit_after>/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Written (W) 2011 <NAME>
 * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
 */

#ifndef CLASSICMDS_H_
#define CLASSICMDS_H_
#ifdef HAVE_LAPACK
#include "preprocessor/DimensionReductionPreprocessor.h"
#include "features/Features.h"
#include "distance/Distance.h"

namespace shogun
{

class CFeatures;
#include "preprocessor/DimensionReductionPreprocessor.h"
class CDistance;

/** @brief the class ClassicMDS used to perform classic eigenvector
 * 	multidimensional scaling.
 *
 * 	Description is given at p.261 (Section 12.1) of
 * 	<NAME>., & <NAME>. (2005).
 * 	Modern multidimensional scaling: Theory and applications. Springer.
 *
 */
class CClassicMDS: public CDimensionReductionPreprocessor
{
public:

	/* constructor */
	CClassicMDS();

	/* destructor */
	virtual ~CClassicMDS();

	/** init
	 * @param data feature vectors for preproc
	 */
	virtual bool init(CFeatures* features);

	/** cleanup
	 *
	 */
	virtual void cleanup();

	/** apply preproc to distance
	 *
	 */
	virtual CSimpleFeatures<float64_t>* apply_to_distance(CDistance* distance);

	/** apply preproc to feature matrix
	 *
	 */
	virtual SGMatrix<float64_t> apply_to_feature_matrix(CFeatures* features);

	/** apply preproc to feature vector
	 *
	 */
	virtual SGVector<float64_t> apply_to_feature_vector(SGVector<float64_t> vector);

	/** get name */
	virtual inline const char* get_name() const { return "CLASSICMDS"; };

	/** get type */
	virtual inline EPreprocessorType get_type() const { return P_CLASSICMDS; };

	/** get last embedding eigenvectors */
	SGVector<float64_t> get_eigenvalues() const
	{
		return m_eigenvalues;
	}

protected:

	/** positive eigenvalues of last call in descending order */
	SGVector<float64_t> m_eigenvalues;

	/** apply preproc to distance
	 *
	 */
	SGMatrix<float64_t> embed_by_distance(CDistance* distance);

};

}

#endif /* HAVE_LAPACK */
#endif /* CLASSICMDS_H_ */
{'fraction_non_alphanumeric': 0.10580284316010254, 'fraction_numerical': 0.014914938242833839, 'mean_word_length': 4.365, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2125262', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1318, 'n_words': 406}