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 LinearRegression
{
public:
LinearRegression(const Trace &data);
double getYfromX(double score) const;
double getIntercept() const;
double getSlope() const;
/** @brief get Root-Mean-Square Deviation
*/
double getRmsd(const Trace &data) const;
/** @brief get Normalized Root-Mean-Square Deviation
*/
double getNrmsd(const Trace &data) const;
/** @brief get Coefficient of determination (R2)
*/
double getCoefficientOfDetermination(const Trace &data) const;
private:
double _slope = 0;
double _intercept = 0;
};
} // namespace pappso
pappso::LinearRegression
Definition: linearregression.h:33
pappso::LinearRegression::getIntercept
double getIntercept() const
Definition: linearregression.cpp:63
pappso::LinearRegression::getNrmsd
double getNrmsd(const Trace &data) const
get Normalized Root-Mean-Square Deviation
Definition: linearregression.cpp:98
pappso::LinearRegression::getYfromX
double getYfromX(double score) const
Definition: linearregression.cpp:73
pappso::LinearRegression::_slope
double _slope
Definition: linearregression.h:51
pappso::LinearRegression::getCoefficientOfDetermination
double getCoefficientOfDetermination(const Trace &data) const
get Coefficient of determination (R2)
Definition: linearregression.cpp:105
pappso::LinearRegression::_intercept
double _intercept
Definition: linearregression.h:52
pappso::LinearRegression::getSlope
double getSlope() const
Definition: linearregression.cpp:68
pappso::LinearRegression::getRmsd
double getRmsd(const Trace &data) const
get Root-Mean-Square Deviation
Definition: linearregression.cpp:79
pappso::LinearRegression::LinearRegression
LinearRegression(const Trace &data)
Definition: linearregression.cpp:32
pappso::Trace
A simple container of DataPoint instances.
Definition: trace.h:148
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
trace.h