Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
451 B
6
Indexable
Never
from sklearn import tree
from sklearn.ensemble import RandomForestClassifier
import numpy as np
import pandas as pd

column_names = ["age", "workclass", "education", "marital-status", "occupation", "relationship", "race", "sex", "capital-gain", 
                "capital-loss", "hours-per-week", "native-country", "income"]
data = pd.read_csv('census_data/adult_train.txt', sep=",", names=column_names)

data['workclass'].replace('?', np.NaN)