Skip to content

Commit afa9342

Browse files
Merge pull request #1008 from KhiopsML/989-khiops_raw_gui-not-active-despite-driver-being-installed
989 khiops raw gui not active despite driver being installed
2 parents 734aa90 + a0775f5 commit afa9342

71 files changed

Lines changed: 198 additions & 374 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ cmake_policy(SET CMP0058 NEW)
2424
cmake_policy(SET CMP0063 NEW)
2525
cmake_policy(SET CMP0083 NEW)
2626

27+
# De-duplicate libraries on link lines (CMake 3.29+); silences Apple ld "ignoring duplicate libraries" warnings that
28+
# arise from diamond static-lib deps
29+
if(POLICY CMP0156)
30+
cmake_policy(SET CMP0156 NEW)
31+
endif()
32+
2733
# Do not add warning flags for MSVC cmake_policy(SET CMP0092 NEW)
2834

2935
# Warn about in-source builds

src/Learning/DTForest/DTAttributeSelection.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ ObjectArray* DTAttributeSelection::GetTreeAttributesFromLevels(const int nMaxAtt
313313
// Repris de l'algo de Weighted Random Sampling with a reservoir Information Processing Letters 97(2006) 181-185
314314

315315
DTTreeAttribute* dtAttribute;
316-
int nAttribute, nMax;
316+
int nAttribute;
317317

318318
if (nMaxAttributesNumber <= 0)
319319
return NULL;
@@ -325,9 +325,6 @@ ObjectArray* DTAttributeSelection::GetTreeAttributesFromLevels(const int nMaxAtt
325325

326326
ivSortedListIndexes.SetSize(0);
327327

328-
nMax = (nMaxAttributesNumber > oaTreeAttributeSelection.GetSize()) ? oaTreeAttributeSelection.GetSize()
329-
: nMaxAttributesNumber;
330-
331328
for (nAttribute = 0; nAttribute < nMaxAttributesNumber; nAttribute++)
332329
{
333330
dtAttribute = cast(DTTreeAttribute*, oaTreeAttributeSelection.GetAt(nAttribute));

src/Learning/DTForest/DTDecisionTreeCreationTask.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ boolean DTDecisionTreeCreationTask::SlaveProcess()
649649
DTDecisionTreeSpec* reportTreeSpec = NULL;
650650
KWLearningSpec* learningSpecTree = NULL;
651651
KWLearningSpec* slaveLearningSpec = NULL;
652-
int nNativeVariableNumber;
653652
ALString sVariableName;
654653
ALString sTmp;
655654
ALString sMessage;
@@ -666,7 +665,6 @@ boolean DTDecisionTreeCreationTask::SlaveProcess()
666665
DTAttributeSelection* attributegenerator;
667666
boolean bRegressionWithEqualFreqDiscretization = false;
668667
boolean bRegressionWithMODLDiscretization = false;
669-
int nBuidTreeNumber;
670668
int nOldSeedTree;
671669

672670
if (randomForestParameter.GetDecisionTreeParameter()->GetVerboseMode())
@@ -676,6 +674,7 @@ boolean DTDecisionTreeCreationTask::SlaveProcess()
676674
}
677675

678676
#ifdef GENERATE_PYTHON_REPORTING_TRACES
677+
int nBuidTreeNumber;
679678
const int oldMaxErrorFlowNumber = Global::GetMaxErrorFlowNumber();
680679
Global::ActivateErrorFlowControl();
681680
Global::SetMaxErrorFlowNumber(10000);
@@ -760,14 +759,13 @@ boolean DTDecisionTreeCreationTask::SlaveProcess()
760759
IntToString(GetTaskIndex() + 1) + "\t" + ALString("Grant memory : \t") +
761760
ALString(LongintToHumanReadableString(GetSlaveResourceGrant()->GetMemory())));
762761
DTTimer_SlaveProcess.Start();
762+
nBuidTreeNumber = 0;
763763
#endif
764764

765765
KWClass* kwcUpdatedClass = shared_learningSpec.GetLearningSpec()->GetClass();
766766

767767
randomForestParameter.CopyFrom(input_forestParameter->GetForestParameter());
768768

769-
nBuidTreeNumber = 0;
770-
771769
// Calcul des arbres
772770
if (bOk and not TaskProgression::IsInterruptionRequested())
773771
{
@@ -820,9 +818,6 @@ boolean DTDecisionTreeCreationTask::SlaveProcess()
820818
learningSpecTree, &blOrigine, shared_odAttributeStats->GetObjectDictionary());
821819
}
822820

823-
// Calcul du nombre de variables initiales
824-
nNativeVariableNumber = slaveLearningSpec->GetInitialAttributeNumber();
825-
826821
// creation pour un slice de selection :
827822
// - des arbres dttree
828823
// - des rapport KWAttributeStats
@@ -904,9 +899,9 @@ boolean DTDecisionTreeCreationTask::SlaveProcess()
904899
learningSpecTree, &blOrigine,
905900
shared_odAttributeStats->GetObjectDictionary());
906901
}
907-
902+
#ifdef GENERATE_PYTHON_REPORTING_TRACES
908903
nBuidTreeNumber++;
909-
904+
#endif
910905
nOldSeedTree = GetRandomSeed();
911906
SetRandomSeed(attributegenerator->GetRandomSeed());
912907

src/Learning/DTForest/DTForestAttributeSelection.cpp

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ void DTForestAttributeSelection::Initialization(const ObjectDictionary* odInputA
5151
{
5252
require(odInputAttributeStats != NULL);
5353

54-
longint nNbInstence = 0;
5554
DTTreeAttribute* taAttribute;
5655
KWAttributeStats* attributeStats;
5756
KWAttribute* attribute;
@@ -63,10 +62,9 @@ void DTForestAttributeSelection::Initialization(const ObjectDictionary* odInputA
6362
odInputAttributeStats->ExportObjectArray(&oaAttributeStats);
6463
nOriginalAttributesNumber = oaAttributeStats.GetSize();
6564

66-
// nombre d'objet dasn la base
65+
// nombre d'objet dans la base
6766
attributeStats = cast(KWAttributeStats*, oaAttributeStats.GetAt(0));
68-
nNbInstence = attributeStats->GetInstanceNumber();
69-
// cout << "les attibut : " << nOriginalAttributesNumber << endl;
67+
7068
for (nAttribute = 0; nAttribute < nOriginalAttributesNumber; nAttribute++)
7169
{
7270
attributeStats = cast(KWAttributeStats*, oaAttributeStats.GetAt(nAttribute));
@@ -102,7 +100,6 @@ void DTForestAttributeSelection::BuildForestUniformSelections(int nmaxselectionn
102100
nMaxSelectionNumber = nmaxselectionnumber;
103101
int nSelection, nAttribute;
104102
int nTinf, nTnull;
105-
int nKinf, nKnull;
106103
int nAttributesNumber;
107104
int nSeed = nRandomSeed;
108105
ObjectArray oaVariablesNull;
@@ -116,20 +113,16 @@ void DTForestAttributeSelection::BuildForestUniformSelections(int nmaxselectionn
116113

117114
Clean();
118115

119-
nKinf = 0;
120-
nKnull = 0;
121116
// calcul des ensemble de variable inf et null
122117
for (nAttribute = 0; nAttribute < nOrigineAttributesNumber; nAttribute++)
123118
{
124119
taAttribute = cast(DTTreeAttribute*, oaOriginalAttributesUsed.GetAt(nAttribute));
125120
if (taAttribute->dLevel == 0.0)
126121
{
127-
nKnull++;
128122
oaVariablesNull.Add(taAttribute);
129123
}
130124
else
131125
{
132-
nKinf++;
133126
oaVariablesInf.Add(taAttribute);
134127
}
135128
}
@@ -140,7 +133,6 @@ void DTForestAttributeSelection::BuildForestUniformSelections(int nmaxselectionn
140133
// le dictionnaire de lecture de la base (i.e : flaggues avec SetUsed(false) et SetLoaded(false)
141134
// ) D'autre part, on a deja verifie que les attributs restants peuvent etre traites en memoire
142135
// (et le cas echeant, on a deja decharge les attributs les moins informatifs)
143-
144136
if (dPct == 0.0)
145137
nAttributesNumber =
146138
(int)(sqrtl(nOrigineAttributesNumber) + log2l(nOrigineAttributesNumber)); // MB
@@ -173,7 +165,7 @@ void DTForestAttributeSelection::BuildForestUniformSelections(int nmaxselectionn
173165
else
174166
oaOriginalAttributesUsed.Shuffle();
175167

176-
// cretation nouvelle liste de variables
168+
// creation nouvelle liste de variables
177169
svRandattibuteselection = new DTAttributeSelection;
178170

179171
svRandattibuteselection->SetRandomSeed(nSeed);
@@ -758,13 +750,7 @@ boolean DTAttributeSelectionsSlices::Check() const
758750
slice = cast(KWDataTableSlice*, oaSlices.GetAt(nSlice));
759751

760752
// Erreur si probleme d'ordre
761-
// if (previousSlice != NULL and previousSlice->CompareLexicographicOrder(slice) >= 0)
762-
//{
763-
// AddError("Wrong ordering between " + slice->GetClassLabel() + "s " +
764-
// previousSlice->GetObjectLabel() + " and " + slice->GetObjectLabel());
765-
// bOk = false;
766-
// break;
767-
//}
753+
assert(previousSlice == NULL or previousSlice->CompareLexicographicOrder(slice) < 0);
768754
previousSlice = slice;
769755

770756
// Erreur si tranche deja utilisee

src/Learning/DTForest/DTGrouperMODLOptimization.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,6 @@ void DTGrouperMODL::FastPostOptimizeGroups(KWFrequencyTable* kwftSource, KWFrequ
13251325
int nStepNumber;
13261326
int nModalityNumber;
13271327
int nGroupNumber;
1328-
int nTargetNumber;
13291328
IntVector ivModalityIndexes;
13301329
IntVector ivGroupIndexes;
13311330
DoubleVector dvGroupCosts;
@@ -1362,10 +1361,9 @@ void DTGrouperMODL::FastPostOptimizeGroups(KWFrequencyTable* kwftSource, KWFrequ
13621361
if (bPrintInitialTables)
13631362
cout << *kwftSource << endl << *kwftTarget << endl;
13641363

1365-
// Memorisation des nombre de modalites, groupes et classes cibles
1364+
// Memorisation des nombre de modalites et groupes
13661365
nModalityNumber = kwftSource->GetFrequencyVectorNumber();
13671366
nGroupNumber = kwftTarget->GetFrequencyVectorNumber();
1368-
nTargetNumber = kwftSource->GetFrequencyVectorSize();
13691367

13701368
// Initialisation des vecteurs d'index des modalites et des groupes
13711369
ivModalityIndexes.SetSize(nModalityNumber);
@@ -1521,7 +1519,6 @@ void DTGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour
15211519
int nStepNumber;
15221520
int nModalityNumber;
15231521
int nGroupNumber;
1524-
int nTargetNumber;
15251522
IntVector ivModalityIndexes;
15261523
IntVector ivGroupIndexes;
15271524
DoubleVector dvGroupCosts;
@@ -1569,10 +1566,10 @@ void DTGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour
15691566
if (bPrintInitialTables)
15701567
cout << *kwftSource << endl << *kwftTarget << endl;
15711568

1572-
// Memorisation des nombre de modalites, groupes et classes cibles
1569+
// Memorisation des nombre de modalites et groupes
15731570
nModalityNumber = kwftSource->GetFrequencyVectorNumber();
15741571
nGroupNumber = kwftTarget->GetFrequencyVectorNumber();
1575-
nTargetNumber = kwftSource->GetFrequencyVectorSize();
1572+
15761573
// Initialisation du nombre de modalites du groupe poubelle
15771574
nGarbageModalityNumber = cast(KWFrequencyVector*, frequencyList->GetHead())->GetModalityNumber();
15781575
nNewGarbageModalityNumber = 0;
@@ -2035,7 +2032,6 @@ void DTGrouperMODL::PostOptimizeGroupsWithGarbageSearch(ObjectArray* oaInitialGr
20352032
boolean bContinue;
20362033
int nModalityNumber;
20372034
int nGroupNumber;
2038-
int nTargetNumber;
20392035
DoubleVector dvGroupCosts;
20402036
DoubleVector dvGroupOutDeltaCosts;
20412037
DoubleVector dvGroupInDeltaCosts;
@@ -2077,10 +2073,9 @@ void DTGrouperMODL::PostOptimizeGroupsWithGarbageSearch(ObjectArray* oaInitialGr
20772073
if (bPrintInitialGroups)
20782074
cout << *oaInitialGroups << endl << *oaNewGroups << endl;
20792075

2080-
// Memorisation des nombre de modalites, groupes et classes cibles
2076+
// Memorisation des nombre de modalites et groupes
20812077
nModalityNumber = oaInitialGroups->GetSize();
20822078
nGroupNumber = oaNewGroups->GetSize();
2083-
nTargetNumber = cast(KWMODLGroup*, oaInitialGroups->GetAt(0))->GetFrequencyVector()->GetSize();
20842079
nTrueGroupNumber = nGroupNumber;
20852080

20862081
// Initialisation du nombre de modalites du groupe poubelle

src/Learning/KDDomainKnowledge/KDClassBuilder.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -899,20 +899,17 @@ void KDClassBuilder::DisplayUsedConstructedBlockRules(const SortedList* slUsedCo
899899
{
900900
POSITION position;
901901
KDSparseUsedConstructedBlockRule* usedConstructedBlockRule;
902-
int nRule;
903902

904903
require(slUsedConstructedBlockRules != NULL);
905904
require(slUsedConstructedBlockRules->GetCompareFunction() == KDSparseUsedConstructedBlockRuleCompareCostName);
906905

907906
// Parcours des regles de la liste
908907
ost << "Used constructed block rules\t" << slUsedConstructedBlockRules->GetCount() << endl;
909-
nRule = 0;
910908
position = slUsedConstructedBlockRules->GetHeadPosition();
911909
while (position != NULL)
912910
{
913911
usedConstructedBlockRule =
914912
cast(KDSparseUsedConstructedBlockRule*, slUsedConstructedBlockRules->GetNext(position));
915-
nRule++;
916913

917914
// Affichage de la regle
918915
ost << *usedConstructedBlockRule->GetConstructedBlockRule() << "\t";

src/Learning/KDDomainKnowledge/KDMultiTableFeatureConstruction.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,7 +2117,6 @@ void KDMultiTableFeatureConstruction::BuildAllSelectionRulesFromSelectionOperand
21172117
double dSelectionOperandProb;
21182118
KDClassSelectionStats* classSelectionStats;
21192119
KDClassSelectionOperandStats* classSelectionOperandStats;
2120-
boolean bRuleFiltered;
21212120
int nInitialRuleNumber;
21222121

21232122
require(selectionRule != NULL);
@@ -2437,7 +2436,6 @@ void KDMultiTableFeatureConstruction::BuildAllSelectionRulesFromSelectionOperand
24372436
}
24382437
}
24392438
// Parcours des tailles de selection
2440-
bRuleFiltered = false;
24412439
for (nSize = 1; nSize <= dvSelectionSizeRandomDrawingNumbers.GetSize(); nSize++)
24422440
{
24432441
dSelectionRandomDrawingNumber = dvSelectionSizeRandomDrawingNumbers.GetAt(nSize - 1);
@@ -2477,8 +2475,7 @@ void KDMultiTableFeatureConstruction::BuildAllSelectionRulesFromSelectionOperand
24772475
oaAllSelectionParts.SetSize(0);
24782476

24792477
// Filtrage des regles pour ne garder que les regles de probabilite suffisantes pour etre tirees
2480-
bRuleFiltered =
2481-
FilterConstructedRulesForRandomDrawing(dRandomDrawingNumber, oaAllConstructedRules);
2478+
FilterConstructedRulesForRandomDrawing(dRandomDrawingNumber, oaAllConstructedRules);
24822479

24832480
// Nettoyage des selections d'operandes
24842481
oaSelectionOperandIndexedFrequencies.DeleteAll();

src/Learning/KNITransfer/KNIDatabaseTransferView.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,15 @@ void KNIDatabaseTransferView::KNITransferDatabase()
3535
{
3636
KNIMTRecodingOperands recodingOperands;
3737
KWMTDatabaseTextFile* sourceMTDatabase;
38-
KWMTDatabaseTextFile* targetMTDatabase;
3938
KWDatabase* workingTargetDatabase;
4039
Timer timerTransfer;
4140
int nMapping;
4241
KWMTDatabaseMapping* mapping;
4342
int nRecordNumber;
4443
ALString sTmp;
4544

46-
// Acces aux bases source et cible
45+
// Acces aux bases source
4746
sourceMTDatabase = cast(KWMTDatabaseTextFile*, sourceDatabase);
48-
targetMTDatabase = cast(KWMTDatabaseTextFile*, targetDatabase);
4947

5048
// On passe par une autre table en sortie, pour pouvoir specifier son chemin si elle n'en a pas
5149
workingTargetDatabase = targetDatabase->Clone();

src/Learning/KNITransfer/KNITransferProblemView.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void KNITransferProblemView::SetObject(Object* object)
5454

5555
// Acces a l'objet edite
5656
learningProblem = cast(KNITransferProblem*, object);
57+
(void)learningProblem; // Evite un warning si on n'utilise pas l'objet dans cette methode
5758
}
5859

5960
KNITransferProblem* KNITransferProblemView::GetTransferProblem()

src/Learning/KWDRRuleLibrary/KWDRDateTime.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,21 +1237,19 @@ TimestampTZ KWDRBuildTimestampTZ::ComputeTimestampTZResult(const KWObject* kwoOb
12371237
TimestampTZ tstzTimestamp;
12381238
Continuous cMinutes;
12391239
int nMinutes;
1240-
boolean bOk;
12411240

12421241
require(IsCompiled());
12431242

12441243
// Modifie la time zone que si les operandes sont valides
12451244
tsTimestamp = GetFirstOperand()->GetTimestampValue(kwoObject);
1246-
bOk = false;
12471245
tstzTimestamp.Reset();
12481246
if (tsTimestamp.Check())
12491247
{
12501248
cMinutes = GetSecondOperand()->GetContinuousValue(kwoObject);
12511249
if (cMinutes != KWContinuous::GetMissingValue())
12521250
{
12531251
nMinutes = int(floor(cMinutes + 0.5));
1254-
bOk = tstzTimestamp.Init(tsTimestamp, nMinutes);
1252+
tstzTimestamp.Init(tsTimestamp, nMinutes);
12551253
}
12561254
}
12571255
return tstzTimestamp;

0 commit comments

Comments
 (0)