forked from Desbordante/desbordante-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generalize TANE and PFDTANE algorithms
Generalize TANE-based algorithms, add additional pFD mining tests.
- Loading branch information
Ilia
committed
Apr 17, 2024
1 parent
24d5d46
commit ca769bb
Showing
7 changed files
with
360 additions
and
591 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,29 @@ | ||
#pragma once | ||
|
||
#include "algorithms/fd/pli_based_fd_algorithm.h" | ||
#include "algorithms/fd/tane/lattice_level.h" | ||
#include "algorithms/fd/tane/tane_common.h" | ||
#include "config/error/type.h" | ||
#include "config/error_measure/type.h" | ||
#include "config/max_lhs/type.h" | ||
#include "enums.h" | ||
#include "model/table/position_list_index.h" | ||
#include "model/table/relation_data.h" | ||
|
||
namespace algos { | ||
|
||
class PFDTane : public PliBasedFDAlgorithm { | ||
class PFDTane : public TaneCommon { | ||
private: | ||
config::ErrorType max_fd_error_; | ||
config::ErrorType max_ucc_error_; | ||
ErrorMeasure error_measure_ = +ErrorMeasure::per_tuple; | ||
|
||
void ResetStateFd() final; | ||
void RegisterOptions(); | ||
void MakeExecuteOptsAvailableFDInternal() final; | ||
void Prune(model::LatticeLevel* level); | ||
void ComputeDependencies(model::LatticeLevel* level); | ||
unsigned long long ExecuteInternal() final; | ||
void MakeExecuteOptsAvailableFDInternal() override final; | ||
config::ErrorType CalculateZeroAryFdError(ColumnData const* rhs) override; | ||
config::ErrorType CalculateFdError(model::PositionListIndex const* lhs_pli, | ||
model::PositionListIndex const* joint_pli) override; | ||
|
||
public: | ||
PFDTane(std::optional<ColumnLayoutRelationDataManager> relation_manager = std::nullopt); | ||
static double CalculateUccError(model::PositionListIndex const* pli, | ||
ColumnLayoutRelationData const* relation_data); | ||
|
||
void RegisterAndCountFd(Vertical const& lhs, Column const* rhs, double error, | ||
RelationalSchema const* schema); | ||
static config::ErrorType CalculateZeroAryFdError(ColumnData const* rhs); | ||
static config::ErrorType CalculateFdError(model::PositionListIndex const* x_pli, | ||
model::PositionListIndex const* xa_pli, | ||
ErrorMeasure error_measure); | ||
PFDTane(); | ||
static config::ErrorType CalculateZeroAryPFDError( | ||
ColumnData const* rhs, ColumnLayoutRelationData const* relation_data); | ||
static config::ErrorType CalculatePFDError(model::PositionListIndex const* x_pli, | ||
model::PositionListIndex const* xa_pli, | ||
ErrorMeasure error_measure, | ||
ColumnLayoutRelationData const* relation_data); | ||
}; | ||
|
||
} // namespace algos |
Oops, something went wrong.