Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
adega
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Odair M.
adega
Commits
9a81c461
Commit
9a81c461
authored
7 years ago
by
João Denis Rodrigues
Browse files
Options
Downloads
Patches
Plain Diff
Concluida analises do curso
parent
32f5bac6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/degree/analysis.py
+46
-7
46 additions, 7 deletions
src/degree/analysis.py
src/utils/data.py
+1
-1
1 addition, 1 deletion
src/utils/data.py
with
47 additions
and
8 deletions
src/degree/analysis.py
+
46
−
7
View file @
9a81c461
...
...
@@ -20,12 +20,12 @@ def average_graduation(degree): # media_formandos
def
average_time_graduation_degree
(
degree
):
# tempo_medio_formatura_curso
students
=
Student
.
objects
.
filter
(
admission__degree
=
degree
)
student_amount
=
students
.
count
()
graduated
=
students
.
filter
(
evasion_form
=
"
Formatura
"
)
graduated_amount
=
graduated
.
count
()
average_time
=
0
for
g
in
graduated
:
print
(
g
.
get_time_in_degree
())
average_time
+=
g
.
get_time_in_degree
()
average_time
/=
graduated_amount
...
...
@@ -40,7 +40,7 @@ def average_general_failure(students):
student_klasses
=
StudentKlass
.
objects
.
filter
(
student
=
student
)
for
sk
in
student_klasses
:
courses
+=
1
if
sk
.
situation
in
SITUATION_FAILURE
:
if
sk
.
situation
in
SITUATION
S
_FAILURE
:
failures
+=
1
return
failures
/
courses
*
100
...
...
@@ -56,7 +56,7 @@ def average_general_failure_standard_deviation(degree): # media_reprovacao_geral
for
sk
in
student_klasses
:
courses
+=
1
if
sk
.
situation
in
SITUATION_FAILURE
:
if
sk
.
situation
in
SITUATION
S
_FAILURE
:
failures
+=
1
variance
+=
math
.
pow
((
failures
/
courses
)
-
average_failure
,
2
)
...
...
@@ -65,16 +65,55 @@ def average_general_failure_standard_deviation(degree): # media_reprovacao_geral
standard_deviation
=
math
.
sqrt
(
variance
)
return
[
average_failure
,
standard_deviation
]
pass
def
average_actives_failure
(
students
):
courses
=
0
failures
=
0
for
student
in
students
:
student_klasses
=
StudentKlass
.
objects
.
filter
(
student
=
student
)
for
sk
in
student_klasses
:
courses
+=
1
if
sk
.
situation
in
SITUATIONS_FAILURE
:
failures
+=
1
return
failures
/
courses
*
100
def
average_actives_failure_standard_deviation
(
degree
):
# media_reprovacao_alunos_cursando_desvio_padrao
pass
students
=
Student
.
objects
.
filter
(
admission__degree
=
degree
,
evasion_form
=
"
Sem evasão
"
)
average_failure
=
average_actives_failure
(
students
)
variance
=
0
for
student
in
students
:
courses
=
0
failures
=
0
student_klasses
=
StudentKlass
.
objects
.
filter
(
student
=
student
)
for
sk
in
student_klasses
:
courses
+=
1
if
sk
.
situation
in
SITUATIONS_FAILURE
:
failures
+=
1
variance
+=
math
.
pow
(
failures
/
courses
-
average_failure
,
2
)
variance
/=
students
.
count
()
standard_deviation
=
math
.
sqrt
(
variance
)
return
[
average_failure
,
standard_deviation
]
def
calculate_average_general_ira_standard_deviation
(
degree
):
# calcular_ira_medio_geral_desvio_padrao
pass
students
=
Student
.
objects
.
filter
(
admission__degree
=
degree
,
ira__isnull
=
False
)
average
=
0
amount
=
students
.
count
()
for
student
in
students
:
average
+=
student
.
ira
return
average
/
amount
def
calculate_average_actives_ira_standard_deviation
(
degree
):
# calcular_ira_medio_atual_desvio_padrao
pass
students
=
Student
.
objects
.
filter
(
admission__degree
=
degree
,
evasion_form
=
"
Sem evasão
"
,
ira__isnull
=
False
)
average
=
0
amount
=
students
.
count
()
for
student
in
students
:
average
+=
student
.
ira
return
average
/
amount
def
calculate_general_evasion
(
degree
):
# calcular_evasao_geral
students
=
Student
.
objects
.
filter
(
admission__degree
=
degree
)
...
...
This diff is collapsed.
Click to expand it.
src/utils/data.py
+
1
−
1
View file @
9a81c461
...
...
@@ -88,7 +88,7 @@ SITUATION_FAILURE_COMPLETED = ( # Situacoes reprovacao cursada ate o fim
)
def
difference_between_semesters
(
year_start
,
semester_start
,
year_end
,
semester_end
):
return
2
*
(
year_end
-
year_start
)
+
(
semester_end
-
year_end
)
+
1
return
2
*
(
year_end
-
year_start
)
+
(
semester_end
-
semester_start
)
+
1
def
merge_dicts
(
dict1
,
dict2
,
dict3
,
keys
):
dict_out
=
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment