14 #ifndef mitkAbstractClassifier_h
15 #define mitkAbstractClassifier_h
23 #include <itkeigen/Eigen/Dense>
61 virtual void Train(
const Eigen::MatrixXd &X,
const Eigen::MatrixXi &Y) = 0;
69 virtual Eigen::MatrixXi
Predict(
const Eigen::MatrixXd &X) = 0;
104 return m_PointWiseWeight;
114 this->m_PointWiseWeight = W;
124 this->m_IsUsingPointWiseWeight = value;
134 return this->m_IsUsingPointWiseWeight;
160 return m_OutProbability;
170 m_IsUsingPointWiseProbability = value;
180 return m_IsUsingPointWiseProbability;
188 void MethodForBuild();
236 if(IsInitialized() ==
false)
239 if(timeGeometry ==
nullptr)
#define MITKCLCORE_EXPORT
Abstract base class for machine learning classifiers.
Eigen::MatrixXd m_OutProbability
virtual void Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y)=0
Train the classifier on a labeled dataset.
Eigen::MatrixXi & GetLabels()
Get the predicted label matrix from the last prediction.
Eigen::MatrixXd m_PointWiseWeight
void SetItemList(std::vector< std::string > list)
Replace the entire item list with the given vector of strings.
std::string GetNthItems(unsigned int idx) const
Get the item string at the given index from the property-based item list.
bool VerifyRequestedRegion() override
Verify that the RequestedRegion is within the LargestPossibleRegion.
virtual bool IsUsingPointWiseWeight()
Query whether per-sample weighting is currently enabled.
virtual Eigen::MatrixXd & GetPointWiseWeight()
Get the per-sample weight matrix.
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Determine whether the RequestedRegion is outside of the BufferedRegion.
virtual bool SupportsPointWiseProbability()=0
Query whether this classifier supports per-sample class probability output.
virtual bool IsUsingPointWiseProbability()
Query whether per-sample class probability output is currently enabled.
virtual Eigen::MatrixXd & GetPointWiseProbabilities()
Get the per-sample class probability matrix from the last prediction.
bool m_IsUsingPointWiseWeight
mitkClassMacro(AbstractClassifier, BaseData)
virtual bool SupportsPointWiseWeight()=0
Query whether this classifier supports per-sample weighting.
bool m_IsUsingPointWiseProbability
void SetRequestedRegionToLargestPossibleRegion() override
Set the RequestedRegion to the LargestPossibleRegion.
bool IsEmpty() const override
Check whether the object contains data at any time step.
virtual void UsePointWiseWeight(bool value)
Enable or disable per-sample weighting during training.
void SetNthItems(const char *val, unsigned int idx)
Set an item in the property-based item list at the given index.
virtual Eigen::MatrixXi Predict(const Eigen::MatrixXd &X)=0
Predict class labels for the given input samples.
virtual void SetPointWiseWeight(const Eigen::MatrixXd &W)
Set the per-sample weight matrix.
std::vector< std::string > GetItemList() const
Retrieve all items from the property-based item list.
virtual void UsePointWiseProbability(bool value)
Enable or disable per-sample class probability computation.
void SetRequestedRegion(const itk::DataObject *) override
Set the requested region from this data object to match the requested region of the data object passe...
Eigen::MatrixXi m_OutLabel
Base class of all data objects.
Find image slices visible on a given plane.