Skip to content

Commit

Permalink
Fixed copy-and-paste bugs of the previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
antononcube committed Jul 21, 2013
1 parent 29d49c2 commit 4051af5
Showing 1 changed file with 19 additions and 34 deletions.
53 changes: 19 additions & 34 deletions AVCDecisionTreeForest.m
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ Mathematica is (C) Copyright 1988-2012 Wolfram Research, Inc.
cdSVDRank_Integer, svdLabels : (All | Automatic | _List)},
preStratifyQ : (True | False)] :=

Block[{axes = axesArg, numAxes, numAvcs, numDataRecs, U, S, V, cU,
cS, cV, numRes = {}, crs, inRules},
Block[{axes = axesArg, numAxes, numAvcs, numDataRecs, U, S, V, cU, cS, cV, numRes = {}, crs, rank, inRules},

(* select linear combination of numerical variables (axes) using thin SVD *)

Expand Down Expand Up @@ -253,42 +252,28 @@ Mathematica is (C) Copyright 1988-2012 Wolfram Research, Inc.
];
PRINT["AVCSplitSelection:: Dimensions[V]=", Dimensions[V]];
PRINT["AVCSplitSelection:: Dimensions[cV]=", Dimensions[cV]];
V = Transpose[Union[Join[Transpose[V], Transpose[cV]], SameTest -> (Abs[#1.#2] >= 0.98 &)]];
If[cdSVDRank > 0,
V = Transpose[Union[Join[Transpose[V], Transpose[cV]], SameTest -> (Abs[#1.#2] >= 0.98 &)]]];
PRINT["AVCSplitSelection:: After union of directions Dimensions[V]=", Dimensions[V]];
{numRes} =
MapThread[
Function[{V, rank},
If[rank == 0, {},
(* compute the variable columns of the linear combinations *)
Assert[numAxes == Dimensions[V][[1]]];
numDataRecs = dataRecs[[All, numAxes]].V;
A
If[preStratifyQ,

numAvcs = Map[AVC[Stratify[numDataRecs[[All, #]], nStrata], classLabels] &, Range[rank]];

numRes =
Table[Append[
AVCFindBestSplitValue[numAvcs[[i]], Number, 0,
impFunc], {numAxes, V[[All, i]]}], {i, rank}],
(* ELSE *)

PRINT["AVCSplitSelection:: Dimensions[numDataRecs]=", Dimensions[numDataRecs]];

numAvcs = Map[AVC[numDataRecs[[All, #]], classLabels] &, Range[rank]];

PRINT["AVCSplitSelection:: Length/@numAvcs = ", Length /@ numAvcs];

numRes =
Table[Append[
AVCFindBestSplitValue[numAvcs[[i]], Number, nStrata,
impFunc], {numAxes, V[[All, i]]}], {i, rank}]
]]],
{{V}, {Dimensions[V][[2]]}}];
rank = Dimensions[V][[2]];
If[rank == 0, {},
(* compute the variable columns of the linear combinations *)
Assert[numAxes == Dimensions[V][[1]]];
numDataRecs = dataRecs[[All, numAxes]].V;
If[preStratifyQ,
numAvcs = Map[AVC[Stratify[numDataRecs[[All, #]], nStrata], classLabels] &, Range[rank]];
numRes = Table[Append[AVCFindBestSplitValue[numAvcs[[i]], Number, 0, impFunc], {numAxes, V[[All, i]]}], {i, rank}],
(* ELSE *)
PRINT["AVCSplitSelection:: Dimensions[numDataRecs]=", Dimensions[numDataRecs]];
numAvcs = Map[AVC[numDataRecs[[All, #]], classLabels] &, Range[rank]];
PRINT["AVCSplitSelection:: Length/@numAvcs = ", Length /@ numAvcs];
numRes = Table[Append[AVCFindBestSplitValue[numAvcs[[i]], Number, nStrata, impFunc], {numAxes, V[[All, i]]}], {i, rank}]
]
];
];
];
];
Join[numRes]
numRes
];

Clear[AVCSplitSelection]
Expand Down

0 comments on commit 4051af5

Please sign in to comment.