Loading...
Searching...
No Matches
linearregression.h
Go to the documentation of this file.
/**
* \file utils/linearregression.h
* \date 17/9/2016
* \author Olivier Langella
* \brief compute linear regression
*/
/*******************************************************************************
* Copyright (c) 2016 Olivier Langella <Olivier.Langella@u-psud.fr>.
*
* This file is part of peptider.
*
* peptider 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.
*
* peptider is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with peptider. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "trace.h"
namespace pappso
{
class PMSPP_LIB_DECL LinearRegression
{
public:
LinearRegression(const Trace &data);
LinearRegression(const LinearRegression &other);
double getYfromX(double score) const;
double getIntercept() const;
double getSlope() const;
/** @brief get Root-Mean-Square Deviation
*/
double getRmsd() const;
/** @brief get Normalized Root-Mean-Square Deviation
*/
double getNrmsd() const;
/** @brief get Coefficient of determination (R2)
*/
double getCoefficientOfDetermination() const;
/** @brief get data size
*/
std::size_t getSize() const;
private:
double m_slope = 0;
double m_intercept = 0;
Trace m_data;
};
} // namespace pappso
pappso::LinearRegression::getIntercept
double getIntercept() const
Definition linearregression.cpp:74
pappso::LinearRegression::getSize
std::size_t getSize() const
get data size
Definition linearregression.cpp:67
pappso::LinearRegression::m_data
Trace m_data
Definition linearregression.h:60
pappso::LinearRegression::m_slope
double m_slope
Definition linearregression.h:58
pappso::LinearRegression::getYfromX
double getYfromX(double score) const
Definition linearregression.cpp:84
pappso::LinearRegression::m_intercept
double m_intercept
Definition linearregression.h:59
pappso::LinearRegression::getRmsd
double getRmsd() const
get Root-Mean-Square Deviation
Definition linearregression.cpp:90
pappso::LinearRegression::getNrmsd
double getNrmsd() const
get Normalized Root-Mean-Square Deviation
Definition linearregression.cpp:108
pappso::LinearRegression::getSlope
double getSlope() const
Definition linearregression.cpp:79
pappso::LinearRegression::LinearRegression
LinearRegression(const Trace &data)
Definition linearregression.cpp:39
pappso::LinearRegression::getCoefficientOfDetermination
double getCoefficientOfDetermination() const
get Coefficient of determination (R2)
Definition linearregression.cpp:115
pappso::Trace
A simple container of DataPoint instances.
Definition trace.h:152
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
trace.h