diff options
| -rw-r--r-- | README.md | 12 | ||||
| -rw-r--r-- | tree.py | 8 |
2 files changed, 10 insertions, 10 deletions
@@ -4,14 +4,14 @@ ## Part1, tree algorithm/implementation: - [X] [tree_grow](https://github.com/Vinkage/2020_data_mining_assignments/blob/e650ad27d13b392f5b6535906e36176cb0777650/assignment1.py#L321-L406) functie die het [pseudocode in de slides](./media/tree_grow_pseudo_code.png) volgt -- [ ] tree_grow aanpassen voor n_feat, een paar lines die zeggen dat de hoeveelheid cols die aan exhaustivesplitsearch gegeven worden random uit x gepakt moeten worden -- [ ] tree_grow_b bootstrap versie van tree grow, die een lijst van tree construct door met replacement rows uit x te kiezen +- [X] tree_grow aanpassen voor n_feat, een paar lines die zeggen dat de hoeveelheid cols die aan exhaustivesplitsearch gegeven worden random uit x gepakt moeten worden +- [X] tree_grow_b bootstrap versie van tree grow, die een lijst van tree construct door met replacement rows uit x te kiezen - [X] [tree_pred functie](https://github.com/Vinkage/2020_data_mining_assignments/blob/da8ca975fb9d11d3801fef66344736e675734c42/assignment1.py#L77-L103) met efficiente conditional branches -- [ ] tree_pred_b een functie die een lijst van tree kan gebruiken om een voorspelling te maken voor rows in een data array x -- [ ] Figure out how we want to compute the confusion matrix (scipy?) -- [ ] Test prediction of single tree on pima indians data with nmin 20 and minleaf 5, check with confusion matrix in [link to assignment](http://www.cs.uu.nl/docs/vakken/mdm/assignment1-2020.pdf) -- [ ] Test prediction on [educode](https://uu.educode.nl/login/?next=/submissions/646/feedback/95016) +- [X] tree_pred_b een functie die een lijst van tree kan gebruiken om een voorspelling te maken voor rows in een data array x +- [X] Figure out how we want to compute the confusion matrix (scipy?) +- [X] Test prediction of single tree on pima indians data with nmin 20 and minleaf 5, check with confusion matrix in [link to assignment](http://www.cs.uu.nl/docs/vakken/mdm/assignment1-2020.pdf) +- [X] Test prediction on [educode](https://uu.educode.nl/login/?next=/submissions/646/feedback/95016) ## Part2, data analysis: @@ -1,10 +1,10 @@ import numpy as np -import cProfile -import pstats +# import cProfile +# import pstats # import tqdm # from tqdm import trange -from pstats import SortKey +# from pstats import SortKey from sklearn import metrics # age,married,house,income,gender,class @@ -252,7 +252,7 @@ def update_mask(mask, current_mask): equal to the total number of rows in dataset x. """ copy = np.array(current_mask, copy=True) - copy[np.where(current_mask)] = mask + copy[current_mask == True] = mask return copy |
