Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Odair M.
adega
Commits
9a81c461
Commit
9a81c461
authored
Jul 31, 2017
by
João Denis Rodrigues
Browse files
Concluida analises do curso
parent
32f5bac6
Changes
2
Hide whitespace changes
Inline
Sidebyside
Showing
2 changed files
with
47 additions
and
8 deletions
+47
8
src/degree/analysis.py
src/degree/analysis.py
+46
7
src/utils/data.py
src/utils/data.py
+1
1
No files found.
src/degree/analysis.py
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
)
...
...
src/utils/data.py
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
=
{}
...
...
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