Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge feature into main branch #1330

Merged
merged 7 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unused functions.
  • Loading branch information
michael-rapp committed Feb 10, 2025
commit bdd1c6aa1fc2a99debc35d09811b4a2d44dd923d
Original file line number Diff line number Diff line change
Expand Up @@ -552,20 +552,6 @@ namespace boosting {
return statePtr_->statisticMatrixPtr->getNumCols();
}

/**
* @see `IStatistics::createUpdate`
*/
std::unique_ptr<IStatisticsUpdate> createUpdate(const CompletePrediction& prediction) override final {
return std::make_unique<Update<CompletePrediction>>(*statePtr_, prediction);
}

/**
* @see `IStatistics::createUpdate`
*/
std::unique_ptr<IStatisticsUpdate> createUpdate(const PartialPrediction& prediction) override final {
return std::make_unique<Update<PartialPrediction>>(*statePtr_, prediction);
}

/**
* @see `IStatistics::evaluatePrediction`
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ class IPrediction : public IIndexVector,
*/
virtual void postProcess(const IPostProcessor& postProcessor) = 0;

/**
* Creates and returns an object of type `IStatisticsUpdate` that allows updating given `IStatistics` based on
* this prediction.
*
* @param statistics A reference to an object of type `IStatistics` that should be updated
* @return An unique pointer to an object of type `IStatisticsUpdate` that has been created
*/
virtual std::unique_ptr<IStatisticsUpdate> createStatisticsUpdate(IStatistics& statistics) const = 0;

/**
* Creates and returns a new subset of the given statistics that only contains the outputs whose indices are
* stored in this vector.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ class CompletePrediction final : public VectorDecorator<AllocatedVector<float64>
const IStatistics& statistics,
const OutOfSampleWeightVector<DenseWeightVector<float32>>& weights) const override;

std::unique_ptr<IStatisticsUpdate> createStatisticsUpdate(IStatistics& statistics) const override;

void applyPrediction(uint32 statisticIndex) override;

void revertPrediction(uint32 statisticIndex) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ class PartialPrediction final : public VectorDecorator<ResizableVector<float64>>
const IStatistics& statistics,
const OutOfSampleWeightVector<DenseWeightVector<float32>>& weights) const override;

std::unique_ptr<IStatisticsUpdate> createStatisticsUpdate(IStatistics& statistics) const override;

void applyPrediction(uint32 statisticIndex) override;

void revertPrediction(uint32 statisticIndex) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
*/
#pragma once

#include "mlrl/common/rule_refinement/prediction_complete.hpp"
#include "mlrl/common/rule_refinement/prediction_partial.hpp"
#include "mlrl/common/sampling/weight_vector_bit.hpp"
#include "mlrl/common/sampling/weight_vector_dense.hpp"
#include "mlrl/common/sampling/weight_vector_equal.hpp"
#include "mlrl/common/sampling/weight_vector_out_of_sample.hpp"
#include "mlrl/common/statistics/statistics_space.hpp"
#include "mlrl/common/statistics/statistics_update.hpp"
#include "mlrl/common/statistics/statistics_weighted.hpp"

#include <memory>
Expand All @@ -25,24 +22,6 @@ class IStatistics : public IStatisticsSpace {

virtual ~IStatistics() override {}

/**
* Creates and returns a new object of type `IStatisticsUpdate` that allows updating the statistics based on the
* predictions of a rule that predicts for all available outputs.
*
* @param prediction A reference to an object of type `CompletePrediction` that stores the scores that are
* predicted by the rule
*/
virtual std::unique_ptr<IStatisticsUpdate> createUpdate(const CompletePrediction& prediction) = 0;

/**
* Creates and returns a new object of type `IStatisticsUpdate` that allows updating the statistics based on the
* predictions of a rule that predicts for a subset of the available outputs.
*
* @param prediction A reference to an object of type `PartialPrediction` that stores the scores that are
* predicted by the rule
*/
virtual std::unique_ptr<IStatisticsUpdate> createUpdate(const PartialPrediction& prediction) = 0;

/**
* Calculates and returns a numerical score that assesses the quality of the current predictions for a specific
* statistic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ std::unique_ptr<IStatisticsSubset> CompletePrediction::createStatisticsSubset(
return statistics.createSubset(indexVector_, weights);
}

std::unique_ptr<IStatisticsUpdate> CompletePrediction::createStatisticsUpdate(IStatistics& statistics) const {
return statistics.createUpdate(*this);
}

void CompletePrediction::applyPrediction(uint32 statisticIndex) {
statisticsUpdatePtr_->applyPrediction(statisticIndex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,6 @@ std::unique_ptr<IStatisticsSubset> PartialPrediction::createStatisticsSubset(
return statistics.createSubset(indexVector_, weights);
}

std::unique_ptr<IStatisticsUpdate> PartialPrediction::createStatisticsUpdate(IStatistics& statistics) const {
return statistics.createUpdate(*this);
}

void PartialPrediction::applyPrediction(uint32 statisticIndex) {
statisticsUpdatePtr_->applyPrediction(statisticIndex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,20 +582,6 @@ namespace seco {
return statePtr_->labelMatrix.numCols;
}

/**
* @see `IStatistics::createUpdate`
*/
std::unique_ptr<IStatisticsUpdate> createUpdate(const CompletePrediction& prediction) override final {
return std::make_unique<Update<CompletePrediction>>(*statePtr_, prediction);
}

/**
* @see `IStatistics::createUpdate`
*/
std::unique_ptr<IStatisticsUpdate> createUpdate(const PartialPrediction& prediction) override final {
return std::make_unique<Update<PartialPrediction>>(*statePtr_, prediction);
}

/**
* @see `IStatistics::evaluatePrediction`
*/
Expand Down
Loading