8000 Aggiunto terzo laboratorio valutato · mathcoding/Programmazione2@896b592 · GitHub
[go: up one dir, main page]

Skip to content

Commit 896b592

Browse files
committed
Aggiunto terzo laboratorio valutato
1 parent 579e792 commit 896b592

File tree

3 files changed

+936
-0
lines changed

3 files changed

+936
-0
lines changed

Assignments/hw2/README.md.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Data Dictionary
2+
3+
Variable Definition Key
4+
survival Survival 0 = No, 1 = Yes
5+
pclass Ticket class 1 = 1st, 2 = 2nd, 3 = 3rd
6+
sex Sex
7+
Age Age in years
8+
sibsp # of siblings / spouses aboard the Titanic
9+
parch # of parents / children aboard the Titanic
10+
ticket Ticket number
11+
fare Passenger fare
12+
cabin Cabin number
13+
embarked Port of Embarkation C = Cherbourg, Q = Queenstown, S = Southampton
14+
Variable Notes
15+
16+
pclass: A proxy for socio-economic status (SES)
17+
1st = Upper
18+
2nd = Middle
19+
3rd = Lower
20+
21+
age: Age is fractional if less than 1. If the age is estimated, is it in the form of xx.5
22+
23+
sibsp: The dataset defines family relations in this way...
24+
Sibling = brother, sister, stepbrother, stepsister
25+
Spouse = husband, wife (mistresses and fianc�s were ignored)
26+
27+
parch: The dataset defines family relations in this way...
28+
Parent = mother, father
29+
Child = daughter, son, stepdaughter, stepson
30+
Some children travelled only with a nanny, therefore parch=0 for them.

Assignments/hw2/compito_MATRICOLA.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
def NomeCognome():
2+
return "Paolo Rossi 423023"
3+
4+
def Train(x_train, y_test):
5+
def Predict(X):
6+
""" Per ogni elemento di X, predice 1 oppure 0, per indicare
7+
se il passaggero corrispondente al vettore X soppravive al disastro """
8+
9+
# DA COMPLETARE CON LA VOSTRA SOLUZIONE
10+
# IN QUESTO CASO: APPROCCIO NAIVE (PESSIMISTICO) RESTITUISCE SEMPRE 0
11+
return list(map(lambda x: 0, X))
12+
13+
# In questo caso ho ignorato il training set
14+
return Predict

0 commit comments

Comments
 (0)
0