Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
544990e3
Commit
544990e3
authored
Dec 10, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
couple of small fixes in rtrees variable importance calculation
parent
fda17273
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
rtrees.cpp
modules/ml/src/rtrees.cpp
+3
-2
No files found.
modules/ml/src/rtrees.cpp
View file @
544990e3
...
...
@@ -233,12 +233,13 @@ public:
oobError
/=
n_oob
;
if
(
rparams
.
calcVarImportance
&&
n_oob
>
1
)
{
Mat
sample_clone
;
oobperm
.
resize
(
n_oob
);
for
(
i
=
0
;
i
<
n_oob
;
i
++
)
oobperm
[
i
]
=
oobidx
[
i
];
for
(
i
=
n_oob
-
1
;
i
>
0
;
--
i
)
//Randomly shuffle indices so we can permute features
{
int
r_i
=
rng
.
uniform
(
0
,
i
+
1
);
int
r_i
=
rng
.
uniform
(
0
,
n_oob
);
std
::
swap
(
oobperm
[
i
],
oobperm
[
r_i
]);
}
...
...
@@ -252,7 +253,7 @@ public:
j
=
oobidx
[
i
];
int
vj
=
oobperm
[
i
];
sample0
=
Mat
(
nallvars
,
1
,
CV_32F
,
psamples
+
sstep0
*
w
->
sidx
[
j
],
sstep1
*
sizeof
(
psamples
[
0
])
);
Mat
sample_clone
=
sample0
.
clone
(
);
//create a copy so we don't mess up the original data
sample0
.
copyTo
(
sample_clone
);
//create a copy so we don't mess up the original data
sample_clone
.
at
<
float
>
(
vi
)
=
psamples
[
sstep0
*
w
->
sidx
[
vj
]
+
sstep1
*
vi
];
double
val
=
predictTrees
(
Range
(
treeidx
,
treeidx
+
1
),
sample_clone
,
predictFlags
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment