From 0d463c119355cd37f3ea06cd5868938fb76cb0a6 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Fri, 25 Sep 2020 08:29:30 +0200 Subject: minor things --- README.md | 12 ++++++------ tree.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4cceab4..67ba629 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/tree.py b/tree.py index e971bd4..3a073ac 100644 --- a/tree.py +++ b/tree.py @@ -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 -- cgit v1.2.3