diff options
| author | Mitsuo Tokumori <[email protected]> | 2023-11-13 21:13:06 -0500 |
|---|---|---|
| committer | Mitsuo Tokumori <[email protected]> | 2023-11-13 21:13:06 -0500 |
| commit | 91533974922ec3dfb1d84f60ddd6e145301ba800 (patch) | |
| tree | af992b77adde0cd79de6a0181074e088b10ed64d | |
| parent | 5e4487a99f357c08662ed5dabd0c7f21664c15eb (diff) | |
| download | ustayml-master.tar.gz ustayml-master.tar.bz2 ustayml-master.zip | |
| -rw-r--r-- | ustayml/schema.sql | 235 | ||||
| -rw-r--r-- | ustayml/static/img/graph-barras.png | bin | 0 -> 20368 bytes | |||
| -rw-r--r-- | ustayml/static/img/graph-feature_importance.png | bin | 0 -> 57816 bytes | |||
| -rw-r--r-- | ustayml/static/img/graph-pie_chart.png | bin | 0 -> 21570 bytes | |||
| -rw-r--r-- | ustayml/static/img/ss_20231113_190519.png | bin | 0 -> 64134 bytes | |||
| -rw-r--r-- | ustayml/static/style.css | 33 | ||||
| -rw-r--r-- | ustayml/templates/dashboard/index.html | 6 | ||||
| -rw-r--r-- | ustayml/templates/students/details.html | 2 | ||||
| -rw-r--r-- | ustayml/templates/students/index.html | 4 | ||||
| -rw-r--r-- | ustayml/views/students.py | 2 |
10 files changed, 189 insertions, 93 deletions
diff --git a/ustayml/schema.sql b/ustayml/schema.sql index a160605..ac3308c 100644 --- a/ustayml/schema.sql +++ b/ustayml/schema.sql @@ -1,8 +1,8 @@ -- System CREATE TABLE user_role ( - id SERIAL PRIMARY KEY, - name TEXT + id SERIAL PRIMARY KEY, + name TEXT ); CREATE TABLE "user" ( @@ -48,25 +48,25 @@ create table administrative_division ( ); CREATE TABLE student ( - id SERIAL PRIMARY KEY, - pucp_code INTEGER, - first_name TEXT, - last_name TEXT, - email TEXT, - -- district TEXT, - administrative_division_id integer, - pucp_unit_id integer, - tuition_bracket TEXT, - current_semester integer, - current_attendance REAL, - current_craest REAL, - current_ppne3 REAL, - current_merit REAL, - est_study_length INTEGER, - est_desertion_risk_class_id integer, - FOREIGN KEY (administrative_division_id) REFERENCES administrative_division (id), - FOREIGN KEY (pucp_unit_id) REFERENCES pucp_unit (id), - FOREIGN KEY (est_desertion_risk_class_id) REFERENCES desertion_risk_class (id) + id SERIAL PRIMARY KEY, + pucp_code INTEGER, + first_name TEXT, + last_name TEXT, + email TEXT, + -- district TEXT, + administrative_division_id integer, + pucp_unit_id integer, + tuition_bracket TEXT, + current_semester integer, + current_attendance REAL, + current_craest REAL, + current_ppne3 REAL, + current_merit REAL, + est_study_length INTEGER, + est_desertion_risk_class_id integer, + FOREIGN KEY (administrative_division_id) REFERENCES administrative_division (id), + FOREIGN KEY (pucp_unit_id) REFERENCES pucp_unit (id), + FOREIGN KEY (est_desertion_risk_class_id) REFERENCES desertion_risk_class (id) ); -- alter table student @@ -79,91 +79,156 @@ CREATE TABLE student ( create view view_student as select stu.*, adm.subdivision3 as "district", puc.name as "pucp_unit", - des.name as "est_desertion_risk_class" + des.name as "est_desertion_risk_class" from student stu - left join administrative_division adm - on stu.administrative_division_id = adm.id - left join pucp_unit as puc - on stu.pucp_unit_id = puc.id - left join desertion_risk_class as des - on stu.est_desertion_risk_class_id = des.id + left join administrative_division adm + on stu.administrative_division_id = adm.id + left join pucp_unit as puc + on stu.pucp_unit_id = puc.id + left join desertion_risk_class as des + on stu.est_desertion_risk_class_id = des.id ; -- SAMPLE DATA (LATER MOVE TO TESTS) INSERT INTO user_role ("id", "name") VALUES - (1, 'admin'), - (2, 'user') + (1, 'admin'), + (2, 'user') ; INSERT INTO "user" ("username","password","role_id") VALUES - ('mitsuo','scrypt:32768:8:1$DNNf1Ah1SwUcFHIU$c0e40293c9ecff498b74e7727a8d9a348371262b85cc880e8c653438b1afa84849adb7230f4fcd995c82de543a7836a5cda2a411a45c17dc653e7036fe3de482',1) + ('mitsuo','scrypt:32768:8:1$DNNf1Ah1SwUcFHIU$c0e40293c9ecff498b74e7727a8d9a348371262b85cc880e8c653438b1afa84849adb7230f4fcd995c82de543a7836a5cda2a411a45c17dc653e7036fe3de482',1) ; INSERT INTO desertion_risk_class ("name") VALUES - ('Alto'), - ('Bajo'), - ('Medio'); + ('Alto'), + ('Bajo'), + ('Medio'); INSERT INTO pucp_unit ("name") VALUES - ('Facultad de Ciencias e Ingenieria'), - ('Estudios Generales Ciencias'); + ('Facultad de Ciencias e Ingenieria'), + ('Estudios Generales Ciencias'); -- sample 2019 data INSERT INTO public.administrative_division (country,subdivision1,subdivision2,subdivision3,subdivision10,ubigeo,population,poverty,name) VALUES - ('Peru','','','','','',29009326,28.9,'country'), - ('Peru','Lima','','','','150000',8981440,15.4,'region'), - ('Peru','Lima','Lima','','','150100',8095747,17.5,'province'), - ('Peru','Lima','Lima','LIMA ','Lima Centro','150101',302056,12.3,'district'), - ('Peru','Lima','Lima','ANCÓN ','Lima Norte','150102',36401,19.6,'district'), - ('Peru','Lima','Lima','ATE ','Lima Este','150103',521692,18.9,'district'), - ('Peru','Lima','Lima','BARRANCO ','Lima Centro','150104',33996,5.3,'district'), - ('Peru','Lima','Lima','BREÑA ','Lima Centro','150105',82987,8.5,'district'), - ('Peru','Lima','Lima','CARABAYLLO ','Lima Norte','150106',237269,26.3,'district'), - ('Peru','Lima','Lima','CHACLACAYO ','Lima Este','150107',42884,10.1,'district'); + ('Peru','','','','','',29009326,28.9,'country'), + ('Peru','Lima','','','','150000',8981440,15.4,'region'), + ('Peru','Lima','Lima','','','150100',8095747,17.5,'province'), + ('Peru','Lima','Lima','LIMA ','Lima Centro','150101',302056,12.3,'district'), + ('Peru','Lima','Lima','ANCÓN ','Lima Norte','150102',36401,19.6,'district'), + ('Peru','Lima','Lima','ATE ','Lima Este','150103',521692,18.9,'district'), + ('Peru','Lima','Lima','BARRANCO ','Lima Centro','150104',33996,5.3,'district'), + ('Peru','Lima','Lima','BREÑA ','Lima Centro','150105',82987,8.5,'district'), + ('Peru','Lima','Lima','CARABAYLLO ','Lima Norte','150106',237269,26.3,'district'), + ('Peru','Lima','Lima','CHACLACAYO ','Lima Este','150107',42884,10.1,'district'); INSERT INTO public.administrative_division (country,subdivision1,subdivision2,subdivision3,subdivision10,ubigeo,population,poverty,name) VALUES - ('Peru','Lima','Lima','CHORRILLOS ','Lima Centro','150108',303913,17.2,'district'), - ('Peru','Lima','Lima','CIENEGUILLA ','Lima Este','150109',31160,24.8,'district'), - ('Peru','Lima','Lima','COMAS ','Lima Norte','150110',509976,22.3,'district'), - ('Peru','Lima','Lima','EL AGUSTINO ','Lima Este','150111',188138,22.1,'district'), - ('Peru','Lima','Lima','INDEPENDENCIA ','Lima Norte','150112',215941,21.3,'district'), - ('Peru','Lima','Lima','JESÚS MARÍA ','Lima Centro','150113',71139,1.7,'district'), - ('Peru','Lima','Lima','LA MOLINA ','Lima Este','150114',144491,0.7,'district'), - ('Peru','Lima','Lima','LA VICTORIA ','Lima Centro','150115',193592,14.9,'district'), - ('Peru','Lima','Lima','LINCE ','Lima Centro','150116',55733,4.0,'district'), - ('Peru','Lima','Lima','LOS OLIVOS ','Lima Norte','150117',339028,13.4,'district'); + ('Peru','Lima','Lima','CHORRILLOS ','Lima Centro','150108',303913,17.2,'district'), + ('Peru','Lima','Lima','CIENEGUILLA ','Lima Este','150109',31160,24.8,'district'), + ('Peru','Lima','Lima','COMAS ','Lima Norte','150110',509976,22.3,'district'), + ('Peru','Lima','Lima','EL AGUSTINO ','Lima Este','150111',188138,22.1,'district'), + ('Peru','Lima','Lima','INDEPENDENCIA ','Lima Norte','150112',215941,21.3,'district'), + ('Peru','Lima','Lima','JESÚS MARÍA ','Lima Centro','150113',71139,1.7,'district'), + ('Peru','Lima','Lima','LA MOLINA ','Lima Este','150114',144491,0.7,'district'), + ('Peru','Lima','Lima','LA VICTORIA ','Lima Centro','150115',193592,14.9,'district'), + ('Peru','Lima','Lima','LINCE ','Lima Centro','150116',55733,4.0,'district'), + ('Peru','Lima','Lima','LOS OLIVOS ','Lima Norte','150117',339028,13.4,'district'); INSERT INTO public.administrative_division (country,subdivision1,subdivision2,subdivision3,subdivision10,ubigeo,population,poverty,name) VALUES - ('Peru','Lima','Lima','LURIGANCHO ','Lima Este','150118',184593,24.4,'district'), - ('Peru','Lima','Lima','LURÍN ','Lima Sur','150119',69282,30.2,'district'), - ('Peru','Lima','Lima','MAGDALENA DEL MAR ','Lima Centro','150120',54116,2.3,'district'), - ('Peru','Lima','Lima','PUEBLO LIBRE','Lima Centro','150121',77892,2.0,'district'), - ('Peru','Lima','Lima','MIRAFLORES ','Lima Centro','150122',86920,0.8,'district'), - ('Peru','Lima','Lima','PACHACAMAC ','Lima Este','150123',81145,32.9,'district'), - ('Peru','Lima','Lima','PUCUSANA ','Lima Sur','150124',12148,26.7,'district'), - ('Peru','Lima','Lima','PUENTE PIEDRA ','Lima Norte','150125',263594,35.6,'district'), - ('Peru','Lima','Lima','PUNTA HERMOSA ','Lima Sur','150126',6309,7.4,'district'), - ('Peru','Lima','Lima','PUNTA NEGRA ','Lima Sur','150127',5951,9.5,'district'); + ('Peru','Lima','Lima','LURIGANCHO ','Lima Este','150118',184593,24.4,'district'), + ('Peru','Lima','Lima','LURÍN ','Lima Sur','150119',69282,30.2,'district'), + ('Peru','Lima','Lima','MAGDALENA DEL MAR ','Lima Centro','150120',54116,2.3,'district'), + ('Peru','Lima','Lima','PUEBLO LIBRE','Lima Centro','150121',77892,2.0,'district'), + ('Peru','Lima','Lima','MIRAFLORES ','Lima Centro','150122',86920,0.8,'district'), + ('Peru','Lima','Lima','PACHACAMAC ','Lima Este','150123',81145,32.9,'district'), + ('Peru','Lima','Lima','PUCUSANA ','Lima Sur','150124',12148,26.7,'district'), + ('Peru','Lima','Lima','PUENTE PIEDRA ','Lima Norte','150125',263594,35.6,'district'), + ('Peru','Lima','Lima','PUNTA HERMOSA ','Lima Sur','150126',6309,7.4,'district'), + ('Peru','Lima','Lima','PUNTA NEGRA ','Lima Sur','150127',5951,9.5,'district'); INSERT INTO public.administrative_division (country,subdivision1,subdivision2,subdivision3,subdivision10,ubigeo,population,poverty,name) VALUES - ('Peru','Lima','Lima','RIMAC ','Lima Centro','150128',178869,16.5,'district'), - ('Peru','Lima','Lima','SAN BARTOLO ','Lima Sur','150129',6368,9.7,'district'), - ('Peru','Lima','Lima','SAN BORJA ','Lima Centro','150130',111208,0.8,'district'), - ('Peru','Lima','Lima','SAN ISIDRO ','Lima Centro','150131',58920,0.6,'district'), - ('Peru','Lima','Lima','SAN JUAN DE LURIGANCHO ','Lima Este','150132',962554,27.0,'district'), - ('Peru','Lima','Lima','SAN JUAN DE MIRAFLORES ','Lima Sur','150133',382531,19.7,'district'), - ('Peru','Lima','Lima','SAN LUIS ','Lima Este','150134',57080,7.1,'district'), - ('Peru','Lima','Lima','SAN MARTÍN DE PORRES ','Lima Norte','150135',620193,10.9,'district'), - ('Peru','Lima','Lima','SAN MIGUEL ','Lima Centro','150136',134666,2.3,'district'), - ('Peru','Lima','Lima','SANTA ANITA ','Lima Este','150137',199282,12.0,'district'); + ('Peru','Lima','Lima','RIMAC ','Lima Centro','150128',178869,16.5,'district'), + ('Peru','Lima','Lima','SAN BARTOLO ','Lima Sur','150129',6368,9.7,'district'), + ('Peru','Lima','Lima','SAN BORJA ','Lima Centro','150130',111208,0.8,'district'), + ('Peru','Lima','Lima','SAN ISIDRO ','Lima Centro','150131',58920,0.6,'district'), + ('Peru','Lima','Lima','SAN JUAN DE LURIGANCHO ','Lima Este','150132',962554,27.0,'district'), + ('Peru','Lima','Lima','SAN JUAN DE MIRAFLORES ','Lima Sur','150133',382531,19.7,'district'), + ('Peru','Lima','Lima','SAN LUIS ','Lima Este','150134',57080,7.1,'district'), + ('Peru','Lima','Lima','SAN MARTÍN DE PORRES ','Lima Norte','150135',620193,10.9,'district'), + ('Peru','Lima','Lima','SAN MIGUEL ','Lima Centro','150136',134666,2.3,'district'), + ('Peru','Lima','Lima','SANTA ANITA ','Lima Este','150137',199282,12.0,'district'); INSERT INTO public.administrative_division (country,subdivision1,subdivision2,subdivision3,subdivision10,ubigeo,population,poverty,name) VALUES - ('Peru','Lima','Lima','SANTA MARÍA DEL MAR ','Lima Sur','150138',924,4.0,'district'), - ('Peru','Lima','Lima','SANTA ROSA ','Lima Norte','150139',12641,12.0,'district'), - ('Peru','Lima','Lima','SANTIAGO DE SURCO ','Lima Centro','150140',309889,3.3,'district'), - ('Peru','Lima','Lima','SURQUILLO ','Lima Centro','150141',93271,5.2,'district'), - ('Peru','Lima','Lima','VILLA EL SALVADOR ','Lima Sur','150142',410313,25.9,'district'), - ('Peru','Lima','Lima','VILLA MARÍA DEL TRIUNFO ','Lima Sur','150143',404692,21.1,'district'); + ('Peru','Lima','Lima','SANTA MARÍA DEL MAR ','Lima Sur','150138',924,4.0,'district'), + ('Peru','Lima','Lima','SANTA ROSA ','Lima Norte','150139',12641,12.0,'district'), + ('Peru','Lima','Lima','SANTIAGO DE SURCO ','Lima Centro','150140',309889,3.3,'district'), + ('Peru','Lima','Lima','SURQUILLO ','Lima Centro','150141',93271,5.2,'district'), + ('Peru','Lima','Lima','VILLA EL SALVADOR ','Lima Sur','150142',410313,25.9,'district'), + ('Peru','Lima','Lima','VILLA MARÍA DEL TRIUNFO ','Lima Sur','150143',404692,21.1,'district'); INSERT INTO student (pucp_code,first_name,last_name,email,administrative_division_id,pucp_unit_id,tuition_bracket,current_semester,current_attendance,current_craest,current_ppne3,current_merit,est_study_length,est_desertion_risk_class_id) VALUES - (20171234,'Alberto','Alvarez','[email protected]',40,1,'G5',5,0.8,58.35,55.23,0.1532,10,1), - (20171235,'Benito','Bueno','[email protected]',41,2,'G5',5,0.8,58.35,55.23,0.1532,10,1), - (20171236,'Carlos','Canto','[email protected]',42,1,'G5',5,0.8,58.35,55.23,0.1532,10,2);
\ No newline at end of file + (20171234,'Alberto','Alvarez','[email protected]',40,1,'G5',5,0.8,58.35,55.23,0.1532,10,1), + (20171235,'Benito','Bueno','[email protected]',41,2,'G5',3,0.8,58.35,55.23,0.1532,10,3), + (20171236,'Carlos','Canto','[email protected]',42,1,'G5',6,0.8,58.35,55.23,0.1532,10,3), + (20171237,'Diana','Diaz','[email protected]',43,2,'G4',6,0.85,60.00,57.00,0.2000,9,1), + (20171238,'Elena','Espino','[email protected]',44,2,'G3',7,0.90,62.00,59.00,0.2500,8,2), + (20171239,'Fernando','Fuentes','[email protected]',45,1,'G2',8,0.95,64.00,61.00,0.3000,7,1), + (20171240,'Gabriela','Gomez','[email protected]',46,2,'G1',4,0.75,56.00,53.00,0.1000,11,3), + (20171241,'Hector','Herrera','[email protected]',7,1,'G5',3,0.70,54.00,51.00,0.0500,12,2), + (20171242,'Irene','Ibarra','[email protected]',8,1,'G4',2,0.65,52.00,49.00,0.0000,13,3), + (20171243,'Jorge','Juarez','[email protected]',9,1,'G3',1,0.60,50.00,47.00,0.0000,14,3), + (20171244,'Karla','Katz','[email protected]',10,2,'G4',5,0.83,59.00,56.00,0.1600,10,2), + (20171245,'Luis','Lima','[email protected]',11,1,'G3',6,0.86,61.00,58.00,0.1700,9,1), + (20171246,'Maria','Mora','[email protected]',12,1,'G2',7,0.89,63.00,60.00,0.1800,8,3), + (20171247,'Nestor','Nava','[email protected]',13,2,'G1',8,0.92,65.00,62.00,0.1900,7,3), + (20171248,'Olga','Ortiz','[email protected]',14,1,'G5',4,0.78,57.00,54.00,0.1500,11,3), + (20171249,'Pablo','Perez','[email protected]',15,1,'G4',3,0.74,55.00,52.00,0.1400,12,1), + (20171250,'Quincy','Quintero','[email protected]',16,1,'G3',2,0.71,53.00,50.00,0.1300,13,3), + (20171251,'Rita','Ramirez','[email protected]',17,1,'G2',1,0.69,51.00,48.00,0.1200,14,2), + (20171252,'Sofia','Sanchez','[email protected]',18,1,'G1',5,0.85,59.00,57.00,0.2000,10,1), + (20171253,'Tomas','Torres','[email protected]',19,2,'G5',6,0.88,61.00,59.00,0.2100,9,3), + (20171254,'Ursula','Urrutia','[email protected]',10,1,'G4',7,0.91,63.00,61.00,0.2200,8,3), + (20171255,'Vicente','Velasquez','[email protected]',11,1,'G3',8,0.94,65.00,63.00,0.2300,7,3), + (20171256,'Wanda','Walsh','[email protected]',12,1,'G2',4,0.77,56.00,53.00,0.1100,11,3), + (20171257,'Ximena','Xu','[email protected]',13,1,'G1',3,0.72,54.00,51.00,0.1000,12,1), + (20171258,'Zabrina','Zoo','[email protected]',14,1,'G9',3,0.72,54.00,51.00,0.1000,12,1), + + (20201234,'Alberto','Alvarez','[email protected]',40,1,'G5',5,0.8,58.35,55.23,0.1532,10,1), + (20201235,'Benito','Bueno','[email protected]',41,2,'G5',3,0.8,58.35,55.23,0.1532,10,3), + (20201236,'Carlos','Canto','[email protected]',42,1,'G5',6,0.8,58.35,55.23,0.1532,10,3), + (20201237,'Diana','Diaz','[email protected]',43,2,'G4',6,0.85,60.00,57.00,0.2000,9,1), + (20201238,'Elena','Espino','[email protected]',44,2,'G3',7,0.90,62.00,59.00,0.2500,8,2), + (20201239,'Fernando','Fuentes','[email protected]',45,1,'G2',8,0.95,64.00,61.00,0.3000,7,1), + (20201240,'Gabriela','Gomez','[email protected]',46,2,'G1',4,0.75,56.00,53.00,0.1000,11,3), + (20201241,'Hector','Herrera','[email protected]',7,1,'G5',3,0.70,54.00,51.00,0.0500,12,2), + (20201242,'Irene','Ibarra','[email protected]',8,1,'G4',2,0.65,52.00,49.00,0.0000,13,3), + (20201243,'Jorge','Juarez','[email protected]',9,1,'G3',1,0.60,50.00,47.00,0.0000,14,3), + (20201244,'Karla','Katz','[email protected]',10,2,'G4',5,0.83,59.00,56.00,0.1600,10,2), + (20201245,'Luis','Lima','[email protected]',11,1,'G3',6,0.86,61.00,58.00,0.1700,9,1), + (20201246,'Maria','Mora','[email protected]',12,1,'G2',7,0.89,63.00,60.00,0.1800,8,3), + (20201247,'Nestor','Nava','[email protected]',13,2,'G1',8,0.92,65.00,62.00,0.1900,7,3), + (20201248,'Olga','Ortiz','[email protected]',14,1,'G5',4,0.78,57.00,54.00,0.1500,11,3), + (20201249,'Pablo','Perez','[email protected]',15,1,'G4',3,0.74,55.00,52.00,0.1400,12,1), + (20201250,'Quincy','Quintero','[email protected]',16,1,'G3',2,0.71,53.00,50.00,0.1300,13,3), + (20201251,'Rita','Ramirez','[email protected]',17,1,'G2',1,0.69,51.00,48.00,0.1200,14,2), + (20201252,'Sofia','Sanchez','[email protected]',18,1,'G1',5,0.85,59.00,57.00,0.2000,10,1), + (20201253,'Tomas','Torres','[email protected]',19,2,'G5',6,0.88,61.00,59.00,0.2100,9,3), + (20201254,'Ursula','Urrutia','[email protected]',10,1,'G4',7,0.91,63.00,61.00,0.2200,8,3), + (20201255,'Vicente','Velasquez','[email protected]',11,1,'G3',8,0.94,65.00,63.00,0.2300,7,3), + (20201256,'Wanda','Walsh','[email protected]',12,1,'G2',4,0.77,56.00,53.00,0.1100,11,3), + (20201257,'Ximena','Xu','[email protected]',13,1,'G1',3,0.72,54.00,51.00,0.1000,12,1), + (20201258,'Zabrina','Zoo','[email protected]',14,1,'G9',3,0.72,54.00,51.00,0.1000,12,1) + ; + -- (20171237,'Dante','Diaz','[email protected]',13,1,'G8',8,0.4,48.25,52.12,0.70,14,1), + -- (20171238,'Eder','Entero','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171239,'Francisco','Falconi','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171240,'Gabriel','Gonzales','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171241,'Hector','Hall','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171242,'Ignacio','Indigo','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171243,'Jose','Juanito','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171244,'Karla','Katz','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171244,'Luis','Lima','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171244,'Maria','Mora','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171244,'Nestor','Nava','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171244,'Olga','Ortiz','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171244,'Pablo','Perez','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171244,'Quincy','Quintero','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- (20171244,'Rita','Ramirez','[email protected]',8,2,'G4',2,0.4,50.00,50.00,0.50,12,0), + -- ;
\ No newline at end of file diff --git a/ustayml/static/img/graph-barras.png b/ustayml/static/img/graph-barras.png Binary files differnew file mode 100644 index 0000000..564d882 --- /dev/null +++ b/ustayml/static/img/graph-barras.png diff --git a/ustayml/static/img/graph-feature_importance.png b/ustayml/static/img/graph-feature_importance.png Binary files differnew file mode 100644 index 0000000..8e509a8 --- /dev/null +++ b/ustayml/static/img/graph-feature_importance.png diff --git a/ustayml/static/img/graph-pie_chart.png b/ustayml/static/img/graph-pie_chart.png Binary files differnew file mode 100644 index 0000000..a9f867b --- /dev/null +++ b/ustayml/static/img/graph-pie_chart.png diff --git a/ustayml/static/img/ss_20231113_190519.png b/ustayml/static/img/ss_20231113_190519.png Binary files differnew file mode 100644 index 0000000..e9dabcd --- /dev/null +++ b/ustayml/static/img/ss_20231113_190519.png diff --git a/ustayml/static/style.css b/ustayml/static/style.css index 3d52059..44da42a 100644 --- a/ustayml/static/style.css +++ b/ustayml/static/style.css @@ -130,7 +130,7 @@ header .action { .tooltip .tooltiptext { visibility: hidden; - width:max-content; + width: max-content; min-width: 10rem; max-width: 60rem; /* white-space: nowrap; */ @@ -237,6 +237,19 @@ header .action { /* student.details */ +.chart { + /* width: 100%; */ + flex-shrink: 1; + overflow: auto; + /* width:min-content; */ +} + +.chart img { + max-width: 100%; + max-height: 100%; + display: block; +} + .student-details-body { display: flex; justify-content: space-between; @@ -290,6 +303,24 @@ ul.data-validation-list li { width: 40%; } +/* dashboard */ + +.dashboard-graphics { + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} + +.dashboard-graphics .flex-item { + flex-basis: calc(50% - 10px); /* Each item takes up 50% width minus the gap */ + margin-bottom: 10px; /* Gap between flex items */ + border: 1px solid #ccc; + padding: 20px; + text-align: center; + box-sizing: border-box; /* Include padding and border in item width */ + max-width: 420px; +} + /* post */ .post > header { diff --git a/ustayml/templates/dashboard/index.html b/ustayml/templates/dashboard/index.html index 3117ec2..a381da9 100644 --- a/ustayml/templates/dashboard/index.html +++ b/ustayml/templates/dashboard/index.html @@ -44,8 +44,8 @@ </form> </div> <div class="dashboard-graphics"> - <div class="chart"> - <img src="{{ url_for('static', filename='img/sample-bar_chart.png') }}"> - </div> + <img class="flex-item" src="{{ url_for('static', filename='img/graph-pie_chart.png') }}"> + <img class="flex-item" src="{{ url_for('static', filename='img/graph-barras.png') }}"> + <img src="{{ url_for('static', filename='img/graph-feature_importance.png') }}"> </div> {% endblock %}
\ No newline at end of file diff --git a/ustayml/templates/students/details.html b/ustayml/templates/students/details.html index 663124c..a1d3869 100644 --- a/ustayml/templates/students/details.html +++ b/ustayml/templates/students/details.html @@ -69,7 +69,7 @@ <div></div> <span>Significancia de variables:</span> <div class="chart"> - <img src="{{ url_for('static', filename='img/sample-bar_chart.png') }}"> + <img src="{{ url_for('static', filename='img/ss_20231113_190519.png') }}"> </div> </div> </div> diff --git a/ustayml/templates/students/index.html b/ustayml/templates/students/index.html index 29d1048..e74ed9c 100644 --- a/ustayml/templates/students/index.html +++ b/ustayml/templates/students/index.html @@ -74,7 +74,7 @@ <th>CRAEst</th> <th>PPNE3</th> <th>mérito</th> - <th>ciclos est.</th> + {# <th>ciclos est.</th> #} <th>riesgo est.</th> </tr> </thead> @@ -90,7 +90,7 @@ <td>{{ student['current_craest'] }}</td> <td>{{ student['current_ppne3'] }}</td> <td>{{ student['current_merit'] }}</td> - <td>{{ student['est_study_length'] }}</td> + {# <td>{{ student['est_study_length'] }}</td> #} <td>{{ student['est_desertion_risk_class'] }}</td> </tr> {% endfor %} diff --git a/ustayml/views/students.py b/ustayml/views/students.py index c3ad563..0f5b9fa 100644 --- a/ustayml/views/students.py +++ b/ustayml/views/students.py @@ -19,7 +19,7 @@ def index(): desertion_risks_class = db.execute("select * from desertion_risk_class;").fetchall() # pagination - pagination = { 'pagesize': 100, 'page': None , 'n_pages': None, 'rowcount': None} + pagination = { 'pagesize': 25, 'page': None , 'n_pages': None, 'rowcount': None} pagination['page'] = int(request.args.get('page', 0)) # filter criteria | field choices |
