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
122a1c2b
Commit
122a1c2b
authored
Jun 23, 2010
by
Maria Dimashova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed case of var_type==0 (ticket 397)
parent
b481f12d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
ertrees.cpp
modules/ml/src/ertrees.cpp
+4
-4
tree.cpp
modules/ml/src/tree.cpp
+4
-4
No files found.
modules/ml/src/ertrees.cpp
View file @
122a1c2b
...
...
@@ -148,8 +148,8 @@ void CvERTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
if
(
sample_count
<
65536
)
is_buf_16u
=
true
;
CV_CALL
(
var_type0
=
cvPreprocessVarType
(
_var_type
,
var_idx
,
var_count
,
&
r_type
));
if
(
_var_type
)
CV_CALL
(
var_type0
=
cvPreprocessVarType
(
_var_type
,
var_idx
,
var_count
,
&
r_type
));
CV_CALL
(
var_type
=
cvCreateMat
(
1
,
var_count
+
2
,
CV_32SC1
));
...
...
@@ -162,8 +162,8 @@ void CvERTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
// step 0. calc the number of categorical vars
for
(
vi
=
0
;
vi
<
var_count
;
vi
++
)
{
var_type
->
data
.
i
[
vi
]
=
var_type0
->
data
.
ptr
[
vi
]
==
CV_VAR_CATEGORICAL
?
cat_var_count
++
:
ord_var_count
--
;
char
vt
=
var_type0
?
var_type0
->
data
.
ptr
[
vi
]
:
CV_VAR_ORDERED
;
var_type
->
data
.
i
[
vi
]
=
vt
==
CV_VAR_CATEGORICAL
?
cat_var_count
++
:
ord_var_count
--
;
}
ord_var_count
=
~
ord_var_count
;
...
...
modules/ml/src/tree.cpp
View file @
122a1c2b
...
...
@@ -252,8 +252,8 @@ void CvDTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
"floating-point vector containing as many elements as "
"the total number of samples in the training data matrix"
);
CV_CALL
(
var_type0
=
cvPreprocessVarType
(
_var_type
,
var_idx
,
var_count
,
&
r_type
));
if
(
_var_type
)
CV_CALL
(
var_type0
=
cvPreprocessVarType
(
_var_type
,
var_idx
,
var_count
,
&
r_type
));
CV_CALL
(
var_type
=
cvCreateMat
(
1
,
var_count
+
2
,
CV_32SC1
));
...
...
@@ -266,8 +266,8 @@ void CvDTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
// step 0. calc the number of categorical vars
for
(
vi
=
0
;
vi
<
var_count
;
vi
++
)
{
var_type
->
data
.
i
[
vi
]
=
var_type0
->
data
.
ptr
[
vi
]
==
CV_VAR_CATEGORICAL
?
cat_var_count
++
:
ord_var_count
--
;
char
vt
=
var_type0
?
var_type0
->
data
.
ptr
[
vi
]
:
CV_VAR_ORDERED
;
var_type
->
data
.
i
[
vi
]
=
vt
==
CV_VAR_CATEGORICAL
?
cat_var_count
++
:
ord_var_count
--
;
}
ord_var_count
=
~
ord_var_count
;
...
...
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