Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
openmole
openmole
Commits
0cc11899
Commit
0cc11899
authored
Jul 07, 2021
by
Juste Raimbault
Browse files
[Tool] Fix StatisticsPackage structure
parent
e26f9be1
Changes
2
Hide whitespace changes
Inline
Side-by-side
openmole/third-parties/org.openmole.tool.statistics/src/main/scala/org/openmole/tool/statistics/StatisticsPackage.scala
0 → 100644
View file @
0cc11899
package
org.openmole.tool.statistics
import
org.openmole.tool.types.ToDouble
trait
StatisticsPackage
extends
Stat
{
stat
⇒
implicit
class
StatisticIterableOfDoubleDecorator
[
T
](
s
:
Seq
[
T
])(
implicit
td
:
ToDouble
[
T
])
{
def
median
:
Double
=
stat
.
median
(
s
.
map
(
td
.
apply
))
def
medianAbsoluteDeviation
=
stat
.
medianAbsoluteDeviation
(
s
.
map
(
td
.
apply
))
def
average
=
stat
.
average
(
s
.
map
(
td
.
apply
))
def
variance
=
stat
.
variance
(
s
.
map
(
td
.
apply
))
def
meanSquaredError
=
stat
.
meanSquaredError
(
s
.
map
(
td
.
apply
))
def
standardDeviation
=
stat
.
standardDeviation
(
s
.
map
(
td
.
apply
))
def
rootMeanSquaredError
=
stat
.
rootMeanSquaredError
(
s
.
map
(
td
.
apply
))
def
normalize
=
stat
.
normalize
(
s
.
map
(
td
.
apply
))
def
absoluteDistance
[
T2
](
to
:
Seq
[
T2
])(
implicit
td2
:
ToDouble
[
T2
])
=
stat
.
absoluteDistance
(
s
.
map
(
td
.
apply
),
to
.
map
(
td2
.
apply
))
def
squareDistance
[
T2
](
to
:
Seq
[
T2
])(
implicit
td2
:
ToDouble
[
T2
])
=
stat
.
squareDistance
(
s
.
map
(
td
.
apply
),
to
.
map
(
td2
.
apply
))
def
dynamicTimeWarpingDistance
[
T2
](
to
:
Seq
[
T2
],
fast
:
Boolean
=
true
)(
implicit
td2
:
ToDouble
[
T2
])
=
stat
.
dynamicTimeWarpingDistance
(
s
.
map
(
td
.
apply
),
to
.
map
(
td2
.
apply
))
}
implicit
def
statisticArrayOfDoubleDecorator
[
T:
ToDouble
](
s
:
Array
[
T
])
=
new
StatisticIterableOfDoubleDecorator
(
s
.
toVector
)
}
openmole/third-parties/org.openmole.tool.statistics/src/main/scala/org/openmole/tool/statistics/package.scala
View file @
0cc11899
...
...
@@ -16,31 +16,4 @@
*/
package
org.openmole.tool
package
statistics
{
import
org.openmole.tool.types.ToDouble
trait
StatisticsPackage
extends
Stat
{
stat
⇒
implicit
class
StatisticIterableOfDoubleDecorator
[
T
](
s
:
Seq
[
T
])(
implicit
td
:
ToDouble
[
T
])
{
def
median
:
Double
=
stat
.
median
(
s
.
map
(
td
.
apply
))
def
medianAbsoluteDeviation
=
stat
.
medianAbsoluteDeviation
(
s
.
map
(
td
.
apply
))
def
average
=
stat
.
average
(
s
.
map
(
td
.
apply
))
def
variance
=
stat
.
variance
(
s
.
map
(
td
.
apply
))
def
meanSquaredError
=
stat
.
meanSquaredError
(
s
.
map
(
td
.
apply
))
def
standardDeviation
=
stat
.
standardDeviation
(
s
.
map
(
td
.
apply
))
def
rootMeanSquaredError
=
stat
.
rootMeanSquaredError
(
s
.
map
(
td
.
apply
))
def
normalize
=
stat
.
normalize
(
s
.
map
(
td
.
apply
))
def
absoluteDistance
[
T2
](
to
:
Seq
[
T2
])(
implicit
td2
:
ToDouble
[
T2
])
=
stat
.
absoluteDistance
(
s
.
map
(
td
.
apply
),
to
.
map
(
td2
.
apply
))
def
squareDistance
[
T2
](
to
:
Seq
[
T2
])(
implicit
td2
:
ToDouble
[
T2
])
=
stat
.
squareDistance
(
s
.
map
(
td
.
apply
),
to
.
map
(
td2
.
apply
))
def
dynamicTimeWarpingDistance
[
T2
](
to
:
Seq
[
T2
],
fast
:
Boolean
=
true
)(
implicit
td2
:
ToDouble
[
T2
])
=
stat
.
dynamicTimeWarpingDistance
(
s
.
map
(
td
.
apply
),
to
.
map
(
td2
.
apply
))
}
implicit
def
statisticArrayOfDoubleDecorator
[
T:
ToDouble
](
s
:
Array
[
T
])
=
new
StatisticIterableOfDoubleDecorator
(
s
.
toVector
)
}
}
package
object
statistics
extends
StatisticsPackage
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