Beggining of decision tree

This commit is contained in:
Robert Bendun 2021-05-22 00:46:33 +02:00
parent 20615a427c
commit a926c6b7c1
3 changed files with 12 additions and 1 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
# Hide node dependencies directory
node_modules
node_modules
__pycache__

10
src/decision_tree/main.py Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/python3
from sklearn import tree
def read_tsv_from(filename):
from csv import reader
with open(filename, 'r') as f:
header, *rows = list(reader(f, delimiter='\t'))
return [dict(zip(header, row)) for row in rows]
print(read_tsv_from('./data.tsv'))