def warn(*args, **kwargs):
    pass
import warnings
warnings.warn = warn

import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn import tree
from sklearn.ensemble import RandomForestClassifier
income_data = pd.read_csv('income.csv',header = 0,delimiter =',')
print(income_data.iloc[0])

labels = income_data[["income"]]
data = income_data[["age"]],"capital-gain","capital-loss","hours-per-week","sex-int"]]
train_data,test_data,train_labels,test_labels = train_test_split(data,labels,random_state = 1)

forest = RandomForestClassifier(random_state =1)
forest.fit(train_data,train_labels)
print(forest.score(test_data,test_labels))
print(income_data["native-country"].value_counts())
