1 | #ifndef theplu_yat_regression_multivariate |
---|

2 | #define theplu_yat_regression_multivariate |
---|

3 | |
---|

4 | // $Id: Multivariate.h 3614 2017-02-06 01:37:33Z peter $ |
---|

5 | |
---|

6 | /* |
---|

7 | Copyright (C) 2017 Peter Johansson |
---|

8 | |
---|

9 | This file is part of the yat library, http://dev.thep.lu.se/yat |
---|

10 | |
---|

11 | The yat library is free software; you can redistribute it and/or |
---|

12 | modify it under the terms of the GNU General Public License as |
---|

13 | published by the Free Software Foundation; either version 3 of the |
---|

14 | License, or (at your option) any later version. |
---|

15 | |
---|

16 | The yat library is distributed in the hope that it will be useful, |
---|

17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|

18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|

19 | General Public License for more details. |
---|

20 | |
---|

21 | You should have received a copy of the GNU General Public License |
---|

22 | along with yat. If not, see <http://www.gnu.org/licenses/>. |
---|

23 | */ |
---|

24 | |
---|

25 | namespace theplu { |
---|

26 | namespace yat { |
---|

27 | namespace utility { |
---|

28 | class Matrix; |
---|

29 | class Vector; |
---|

30 | class VectorBase; |
---|

31 | } |
---|

32 | namespace regression { |
---|

33 | |
---|

34 | /** |
---|

35 | Interface class for multivariate regression classes. |
---|

36 | |
---|

37 | \since new in yat 0.15 |
---|

38 | */ |
---|

39 | class Multivariate |
---|

40 | { |
---|

41 | public: |
---|

42 | /** |
---|

43 | \brief destructor |
---|

44 | */ |
---|

45 | virtual ~Multivariate(void); |
---|

46 | |
---|

47 | /** |
---|

48 | Estimating model parameters based on \a X to fit output data \a |
---|

49 | y. Each row in \a X corresponds to one data point, i.e., number |
---|

50 | of rows in \a X must match size of \a y. |
---|

51 | */ |
---|

52 | virtual void fit(const utility::Matrix& x, const utility::VectorBase& y)=0; |
---|

53 | |
---|

54 | /** |
---|

55 | \return parameters of the model |
---|

56 | */ |
---|

57 | virtual const utility::Vector& fit_parameters(void) const=0; |
---|

58 | |
---|

59 | /** |
---|

60 | \brief predict value in \a x according to model |
---|

61 | */ |
---|

62 | virtual double predict(const utility::VectorBase& x) const=0; |
---|

63 | }; |
---|

64 | |
---|

65 | }}} |
---|

66 | |
---|

67 | #endif |
---|