Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkGeneralizedLinearModel.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkGeneralizedLinearModel_h
14 #define mitkGeneralizedLinearModel_h
15 
16 #include <MitkCLImportanceWeightingExports.h>
17 
18 #include <vnl/vnl_matrix.h>
19 #include <vnl/vnl_vector.h>
20 
21 namespace mitk
22 {
30  class MITKCLIMPORTANCEWEIGHTING_EXPORT GeneralizedLinearModel
31  {
32  public:
43  GeneralizedLinearModel (const vnl_matrix<double> &xData, const vnl_vector<double> &yData, bool addConstantColumn=true);
44 
56  double Predict(const vnl_vector<double> &c);
57 
69  vnl_vector<double> Predict(const vnl_matrix<double> &x);
70 
79  vnl_vector<double> ExpMu(const vnl_matrix<double> &x);
80 
84  vnl_vector<double> B();
85 
86  private:
87 
88  // Estimates the rank of the matrix and creates a permutation vector so
89  // that the most important columns are first. Depends on a QR-algorithm.
90  void EstimatePermutation(const vnl_matrix<double> &xData);
91 
92  vnl_vector<unsigned int> m_Permutation; // Holds a permutation matrix which is used during calculation of B
93  vnl_vector<double> m_B; // B-Values. Linear componentn of the model.
94  bool m_AddConstantColumn; // If true, a constant value is added to each row
95 // int m_Rank; // The estimated input rank of the matrix.
96  };
97 }
98 
99 #endif
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::GeneralizedLinearModel
Generalized Linear Model that allows linear models for non-gaussian data.
Definition: mitkGeneralizedLinearModel.h:30