Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
alpha-mind
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr.李
alpha-mind
Commits
b9afdb8f
Commit
b9afdb8f
authored
Apr 25, 2017
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go on ...
parent
29cd24b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
standardize.py
alphamind/data/standardize.py
+2
-2
winsorize.py
alphamind/data/winsorize.py
+2
-2
No files found.
alphamind/data/standardize.py
View file @
b9afdb8f
...
...
@@ -12,8 +12,8 @@ import numpy_groupies as npg
def
standardize
(
x
:
np
.
ndarray
,
groups
:
np
.
ndarray
=
None
)
->
np
.
ndarray
:
if
groups
is
not
None
:
mean_values
=
npg
.
aggregate_n
p
(
groups
,
x
,
axis
=
0
,
func
=
'mean'
)
std_values
=
npg
.
aggregate_n
p
(
groups
,
x
,
axis
=
0
,
func
=
'std'
,
ddof
=
1
)
mean_values
=
npg
.
aggregate_n
b
(
groups
,
x
,
axis
=
0
,
func
=
'mean'
)
std_values
=
npg
.
aggregate_n
b
(
groups
,
x
,
axis
=
0
,
func
=
'std'
,
ddof
=
1
)
value_index
=
np
.
searchsorted
(
range
(
len
(
mean_values
)),
groups
)
...
...
alphamind/data/winsorize.py
View file @
b9afdb8f
...
...
@@ -12,8 +12,8 @@ import numpy_groupies as npg
def
winsorize_normal
(
x
:
np
.
ndarray
,
num_stds
:
int
=
3
,
groups
:
np
.
ndarray
=
None
)
->
np
.
ndarray
:
if
groups
is
not
None
:
mean_values
=
npg
.
aggregate_n
p
(
groups
,
x
,
axis
=
0
,
func
=
'mean'
)
std_values
=
npg
.
aggregate_n
p
(
groups
,
x
,
axis
=
0
,
func
=
'std'
,
ddof
=
1
)
mean_values
=
npg
.
aggregate_n
b
(
groups
,
x
,
axis
=
0
,
func
=
'mean'
)
std_values
=
npg
.
aggregate_n
b
(
groups
,
x
,
axis
=
0
,
func
=
'std'
,
ddof
=
1
)
value_index
=
np
.
searchsorted
(
range
(
len
(
mean_values
)),
groups
)
...
...
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