Skip to content

Commit

Permalink
The option LinearCombinations can take Automatic as a value.
Browse files Browse the repository at this point in the history
  • Loading branch information
antononcube committed Mar 9, 2014
1 parent 8f1bfcd commit 268bd34
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions AVCDecisionTreeForest.m
Original file line number Diff line number Diff line change
Expand Up @@ -422,15 +422,20 @@ Mathematica is (C) Copyright 1988-2012 Wolfram Research, Inc.
(* Options handling *)
nNumVars = Count[columnTypes, Number];
lbls = Union[data[[All, -1]]];
If[ ! TrueQ[ linComb==False || linComb==None ],
{linCombMinRecs, linCombMaxRecs, svdRank, cdSVDRank, svdLabels} = {"MinSize", "MaxSize", "Rank", "CentralizedDataRank", "Labels"} /. linComb /. {"MinSize" -> Automatic, "MaxSize" -> Automatic, "Rank" -> 2, "CentralizedDataRank" -> Automatic, "Labels" -> Automatic},
Which[
TrueQ[ linComb === Automatic ],
{linCombMinRecs, linCombMaxRecs, svdRank, cdSVDRank, svdLabels} = {Automatic, Automatic, Automatic, Automatic, Automatic},
! TrueQ[ linComb==False || linComb==None ],
{linCombMinRecs, linCombMaxRecs, svdRank, cdSVDRank, svdLabels} = {"MinSize", "MaxSize", "Rank", "CentralizedDataRank", "Labels"} /. linComb /. {"MinSize" -> Automatic, "MaxSize" -> Automatic, "Rank" -> Automatic, "CentralizedDataRank" -> Automatic, "Labels" -> Automatic},
True,
{linCombMinRecs, linCombMaxRecs, svdRank, cdSVDRank, svdLabels} = {Length[data], Length[data], 0, 0, {}}
];
If[ nNumVars==0,
{linCombMinRecs, linCombMaxRecs, svdRank, cdSVDRank, svdLabels} = {Length[data], Length[data], 0, 0, {}}
];
If[TrueQ[linCombMinRecs === Automatic], linCombMinRecs = Floor[0.1 Dimensions[data][[1]]]];
If[TrueQ[linCombMaxRecs === Automatic], linCombMaxRecs = Dimensions[data][[1]]];
If[TrueQ[svdRank === Automatic], svdRank = 2];
If[TrueQ[cdSVDRank === Automatic], cdSVDRank = svdRank];
If[! (IntegerQ[linCombMinRecs] && linCombMinRecs > 0),
Message[BuildDecisionTree::iavalopt, "MinSize", 1, Length[data]];
Expand Down

0 comments on commit 268bd34

Please sign in to comment.