Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
inventario
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Luis Gordillo Ruiz
inventario
Commits
58af0142
Commit
58af0142
authored
Feb 06, 2025
by
Jose Luis Gordillo Ruiz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
figuras de correlación en Macros y iAUCs
parent
36cbcb1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
estadisticas.py
+40
-0
No files found.
estadisticas.py
View file @
58af0142
...
...
@@ -14,6 +14,40 @@ import flask
server
=
flask
.
Flask
(
__name__
)
def
update_correlacion_macro_iauc
():
datos
=
comidas
.
sort_values
(
by
=
"iAUC"
,
ascending
=
True
)
datos
=
datos
[
np
.
abs
(
stats
.
zscore
(
datos
[
"iAUC"
],
nan_policy
=
'omit'
))
<
3
]
datos
.
reset_index
(
inplace
=
True
)
metricas
=
[
"hc_total"
,
"lipids_total"
,
"protein_total"
,
"fiber_total"
]
pcts
=
[
metrica
+
"_pct"
for
metrica
in
metricas
]
datos
[
"total"
]
=
datos
[
metricas
]
.
sum
(
axis
=
1
)
datos
=
datos
[
datos
[
"total"
]
>
0
]
datos
[
pcts
]
=
datos
[
metricas
]
.
div
(
datos
[
"total"
],
axis
=
0
)
fig
=
make_subplots
(
rows
=
2
,
cols
=
4
,
vertical_spacing
=
0.25
)
lcol
=
1
seq
=
1
for
metrica
in
metricas
:
datosfil
=
datos
[
np
.
abs
(
stats
.
zscore
(
datos
[
metrica
],
nan_policy
=
'omit'
))
<
3
]
fig
.
add_trace
(
go
.
Scatter
(
x
=
datosfil
[
"iAUC"
],
y
=
datosfil
[
metrica
],
name
=
metrica
,
mode
=
'markers'
),
row
=
1
,
col
=
lcol
)
fig
.
add_trace
(
go
.
Scatter
(
x
=
datosfil
[
"iAUC"
],
y
=
datosfil
[
metrica
+
"_pct"
],
name
=
metrica
,
mode
=
'markers'
),
row
=
2
,
col
=
lcol
)
fig
[
"layout"
][
'xaxis'
+
str
(
seq
)][
'title'
]
=
"iAUC"
fig
[
"layout"
][
'yaxis'
+
str
(
seq
)][
'title'
]
=
metrica
fig
[
"layout"
][
'xaxis'
+
str
(
seq
+
4
)][
'title'
]
=
"iAUC"
fig
[
"layout"
][
'yaxis'
+
str
(
seq
+
4
)][
'title'
]
=
"pct de "
+
metrica
lcol
=
lcol
+
1
seq
=
seq
+
1
return
fig
def
datavis
(
datos
):
medidas
=
[
"imc"
,
"age"
,
"glucose"
,
"hba1c"
,
"ct"
,
"hdl"
]
fig
=
make_subplots
(
rows
=
2
,
cols
=
3
,
vertical_spacing
=
0.25
)
...
...
@@ -630,6 +664,12 @@ app.layout = html.Div(children=[
html
.
Div
(
children
=
[
html
.
H1
(
"Distribución de
%
s de Macronutrientes de comidas"
,
className
=
"header-title2"
)]),
dcc
.
Graph
(
figure
=
comidas_porcentajes
(
comidas
))
,]),
# relación de macronutrientes de comidas con sus iAUC
html
.
Div
(
children
=
[
html
.
Div
(
children
=
[
html
.
H1
(
"Relación de macros / iAUCs de las comidas "
,
className
=
"header-title2"
)]),
dcc
.
Graph
(
figure
=
update_correlacion_macro_iauc
())
,]),
# # de comidas por componente dominante
html
.
Div
(
children
=
[
html
.
Div
(
children
=
[
html
.
H1
(
"Distribución de num. de comidas por componente principal"
,
className
=
"header-title2"
)]),
...
...
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