Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
75563503
Commit
75563503
authored
Mar 23, 2020
by
Alessio Netti
Browse files
Analytics: minor fix to the Regressor and Classifier plugins
parent
834246bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
analytics/operators/regressor/RegressorOperator.cpp
View file @
75563503
...
...
@@ -199,12 +199,13 @@ void RegressorOperator::computeFeatureVector(U_Ptr unit) {
uint64_t
startTs
=
endTs
-
_aggregationWindow
;
std
::
vector
<
RegressorSBPtr
>&
inputs
=
unit
->
getInputs
();
for
(
idx
=
0
;
idx
<
inputs
.
size
();
idx
++
)
{
_mean
=
0
;
_std
=
0
;
_diffsum
=
0
;
_qtl25
=
0
;
_qtl75
=
0
;
_mean
=
0
;
_std
=
0
;
_diffsum
=
0
;
_qtl25
=
0
;
_qtl75
=
0
;
_latest
=
0
;
_buffer
.
clear
();
if
(
!
_queryEngine
.
querySensor
(
inputs
[
idx
]
->
getName
(),
startTs
,
endTs
,
_buffer
,
false
)
||
_buffer
.
empty
())
throw
std
::
runtime_error
(
"Operator "
+
_name
+
": cannot read from sensor "
+
inputs
[
idx
]
->
getName
()
+
"!"
);
_latest
=
_buffer
.
back
().
value
;
if
(
inputs
[
idx
]
->
getTrainingTarget
())
_currentTarget
=
(
float
)
_
buffer
.
back
().
value
;
_currentTarget
=
(
float
)
_
latest
;
if
(
!
inputs
[
idx
]
->
getTrainingTarget
()
||
_includeTarget
)
{
// Computing MEAN and SUM OF DIFFERENCES
...
...
@@ -245,7 +246,7 @@ void RegressorOperator::computeFeatureVector(U_Ptr unit) {
_currentfVector
->
at
<
float
>
(
fIdx
+
2
)
=
(
float
)
_diffsum
;
_currentfVector
->
at
<
float
>
(
fIdx
+
3
)
=
(
float
)
_qtl25
;
_currentfVector
->
at
<
float
>
(
fIdx
+
4
)
=
(
float
)
_qtl75
;
_currentfVector
->
at
<
float
>
(
fIdx
+
5
)
=
(
float
)
_
buffer
[
_buffer
.
size
()
-
1
].
value
;
_currentfVector
->
at
<
float
>
(
fIdx
+
5
)
=
(
float
)
_
latest
;
}
else
{
fIdx
=
idx
*
REG_NUMFEATURES
;
_currentfVector
->
at
<
float
>
(
fIdx
)
=
0.0
f
;
...
...
analytics/operators/regressor/RegressorOperator.h
View file @
75563503
...
...
@@ -103,6 +103,7 @@ protected:
int64_t
_diffsum
;
int64_t
_qtl25
;
int64_t
_qtl75
;
int64_t
_latest
;
// Helper struct to store importance pairs
struct
ImportancePair
{
...
...
Write
Preview
Supports
Markdown
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