Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iPPIDB
ippidb-web
Commits
b5fbad1e
Commit
b5fbad1e
authored
Feb 10, 2021
by
Fabien MAREUIL
Browse files
add factor normalization
parent
24e91a89
Pipeline
#47628
passed with stages
in 20 minutes and 18 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ippisite/ippidb/migrations/0067_metainformation_normalize_factor.py
0 → 100644
View file @
b5fbad1e
# Generated by Django 2.2.1 on 2021-02-10 13:55
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'ippidb'
,
'0066_merge_20210128_0926'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'metainformation'
,
name
=
'normalize_factor'
,
field
=
models
.
DecimalField
(
blank
=
True
,
decimal_places
=
8
,
default
=
4.5859973
,
max_digits
=
11
,
null
=
True
,
verbose_name
=
'Normalize Factor'
),
),
]
ippisite/ippidb/models/targetcentric.py
View file @
b5fbad1e
...
...
@@ -426,6 +426,14 @@ class MetaInformation(models.Model):
minimum
=
models
.
DecimalField
(
verbose_name
=
"Minimum"
,
max_digits
=
11
,
decimal_places
=
8
)
normalize_factor
=
models
.
DecimalField
(
blank
=
True
,
null
=
True
,
default
=
4.58599730
,
verbose_name
=
"Normalize Factor"
,
max_digits
=
11
,
decimal_places
=
8
,
)
class
Meta
:
verbose_name_plural
=
"MetaInformation"
...
...
ippisite/ippidb/templatetags/customtags.py
View file @
b5fbad1e
...
...
@@ -262,10 +262,10 @@ def get_zscore_threshold(avg_std):
@
register
.
filter
def
get_zscore
(
distance
,
avg_std
):
std
=
float
(
avg_std
.
std
)
factor
=
float
(
avg_std
.
normalize_factor
)
# mean = float(avg_std.average)
dist
=
float
(
distance
)
score
=
np
.
exp
(
-
((
dist
**
2
)
/
(
2
*
(
std
**
2
))))
score
=
np
.
exp
(
-
((
dist
**
2
)
/
(
2
*
(
factor
**
2
))))
return
score
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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