Skip to content

Commit

Permalink
Gestion de typycalite negative lors des relecture de rapport de coclu…
Browse files Browse the repository at this point in the history
…stering

- provoque un bug dans LearningTest\TestCoclustering\Bugs\NegativeTypicalities
- ajout d'une tolerance: les typicalite négative des rapport sont remplacées par 0
- impacts:
 - CCCoclusteringReport::ReadComposition
 - CCCoclusteringReport::ReadJSONTypicalities

Test complets effectues sur LearningTest\TestCoclustering
- Standard, SmallInstabilities, Bugs, NewPriorV9
- y_CoclusteringIV_Standard
  • Loading branch information
marcboulle committed Oct 4, 2023
1 parent 147bef1 commit 7db71cf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
25 changes: 18 additions & 7 deletions src/Learning/MODL_Coclustering/CCCoclusteringBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ boolean CCCoclusteringBuilder::CheckVarPartSpecifications() const
boolean CCCoclusteringBuilder::ComputeCoclustering()
{
boolean bOk = true;
boolean bProfileOptimisation = true;
boolean bProfileOptimisation = false;
KWTupleTable tupleTable;
KWTupleTable tupleFrequencyTable;
CCCoclusteringOptimizer dataGridOptimizer;
Expand Down Expand Up @@ -456,13 +456,24 @@ boolean CCCoclusteringBuilder::ComputeCoclustering()
if (bProfileOptimisation)
{
// Nom du fichier de profiling, avec le nombre d'individus et de variables
sProfileFileName = "C:/temp/DataGridOptimizationProfiling";
sProfileFileName = "C:/temp/DataGridOptimizationProfiling_";
sProfileFileName += GetDatabase()->GetClassName();
sProfileFileName += '(';
sProfileFileName += IntToString(initialDataGrid->GetAttributeAt(0)->GetInitialValueNumber());
sProfileFileName += ',';
sProfileFileName += IntToString(initialDataGrid->GetInnerAttributes()->GetInnerAttributeNumber());
sProfileFileName += ").txt";
if (initialDataGrid->IsVarPartDataGrid())
{
sProfileFileName += "_I";
sProfileFileName += IntToString(initialDataGrid->GetAttributeAt(0)->GetInitialValueNumber());
sProfileFileName += "_V";
sProfileFileName +=
IntToString(initialDataGrid->GetInnerAttributes()->GetInnerAttributeNumber());
}
else
{
sProfileFileName += "_F";
sProfileFileName += IntToString(initialDataGrid->GetGridFrequency());
sProfileFileName += "_D";
sProfileFileName += IntToString(initialDataGrid->GetAttributeNumber());
}
sProfileFileName += ".txt";

// Lancement du profiling
KWDataGridOptimizer::GetProfiler()->SetTrace(true);
Expand Down
11 changes: 9 additions & 2 deletions src/Learning/MODL_Coclustering/CCCoclusteringReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1692,9 +1692,13 @@ boolean CCCoclusteringReport::ReadComposition(CCHierarchicalDataGrid* coclusteri
{
// Tolerance pour les typicalite negatives
if (dTypicality < 0)
{
AddWarning(sTmp + "Value specification (" + sValueName +
") with typicality less than 0 for variable " +
dgAttribute->GetAttributeName());
dgAttribute->GetAttributeName() +
" (replaced by 0)");
dTypicality = 0;
}
// Erreur pour les typicalite supereures a 1
else
{
Expand Down Expand Up @@ -3906,10 +3910,13 @@ boolean CCCoclusteringReport::ReadJSONTypicalities(KWDGAttribute* dgAttribute, i

// Tolerance pour les typicalite negatives
if (dValueTypicality < 0)
{
AddWarning(sTmp + "Typicality (" + DoubleToString(dValueTypicality) +
") less than 0 for variable " + dgAttribute->GetAttributeName() +
" in \"valueTypicalities\" line " +
IntToString(JSONTokenizer::GetCurrentLineIndex()));
IntToString(JSONTokenizer::GetCurrentLineIndex()) + " (replaced by 0)");
dValueTypicality = 0;
}
// Erreur pour les typicalite supereures a 1
else if (dValueTypicality > 1)
{
Expand Down
1 change: 1 addition & 0 deletions src/Learning/MODL_Coclustering/MODL_Coclustering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ int main(int argc, char** argv)
// Choix du repertoire de lancement pour le debugage sous Windows (a commenter apres fin du debug)
//SetWindowsDebugDir("y_CoclusteringIV_Standard", "IrisLight");
//SetWindowsDebugDir("y_CoclusteringIV_Standard", "Iris");
SetWindowsDebugDir("Bugs", "NegativeTypicalities");

// Point d'arret sur l'allocation d'un bloc memoire
// MemSetAllocIndexExit(77);
Expand Down

0 comments on commit 7db71cf

Please sign in to comment.