PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
Classes | Public Member Functions | Public Attributes | List of all members
plssvm::data_set< T, U >::scaling Class Reference

Implements all necessary data and functions needed for scaling a plssvm::data_set to an user-defined range. More...

#include <data_set.hpp>

Classes

struct  factors
 The calculated or read feature-wise scaling factors. More...
 

Public Member Functions

 scaling (real_type lower, real_type upper)
 Create a new scaling class that can be used to scale all features of a data set to the interval [lower, upper]. More...
 
 scaling (const std::string &filename)
 Read the scaling interval and factors from the provided file filename. More...
 
void save (const std::string &filename) const
 Save the scaling factors to the file filename. More...
 

Public Attributes

std::pair< real_type, real_typescaling_interval {}
 The user-provided scaling interval. After scaling, all feature values are scaled to [lower, upper].
 
std::vector< factorsscaling_factors {}
 The scaling factors for all features.
 

Detailed Description

template<typename T, typename U = int>
class plssvm::data_set< T, U >::scaling

Implements all necessary data and functions needed for scaling a plssvm::data_set to an user-defined range.

Constructor & Destructor Documentation

◆ scaling() [1/2]

template<typename T , typename U >
plssvm::data_set< T, U >::scaling::scaling ( real_type  lower,
real_type  upper 
)

Create a new scaling class that can be used to scale all features of a data set to the interval [lower, upper].

Parameters
[in]lowerthe lower bound value of all features
[in]upperthe upper bound value of all features
Exceptions
plssvm::data_set_exceptionif lower is greater or equal than upper

◆ scaling() [2/2]

template<typename T , typename U >
plssvm::data_set< T, U >::scaling::scaling ( const std::string &  filename)

Read the scaling interval and factors from the provided file filename.

Parameters
[in]filenamethe filename to read the scaling information from
Exceptions
plssvm::invalid_file_format_exceptionall exceptions thrown by the plssvm::detail::io::parse_scaling_factors function

Member Function Documentation

◆ save()

template<typename T , typename U >
void plssvm::data_set< T, U >::scaling::save ( const std::string &  filename) const

Save the scaling factors to the file filename.

Parameters
[in]filenamethe file to save the scaling factors to
Exceptions
plssvm::data_set_exceptionif no scaling factors are available

The documentation for this class was generated from the following file: