dataset = pd.read_csv(
    '/home/felipe/Documentos/Machine Learning A-Z/' +
    'Part 3 - Classification/Section 14 - Logistic Regression/Social_Network_Ads.csv'
)
ind_var = dataset.iloc[:, :-1].values
dep_var = dataset.iloc[:, -1].values

# Search for missing values
# No missing data.

# Column #0 is useless and #1 is not a good parameter.
ind_var = ind_var[:, 2:(ind_var.shape[1] + 1)]

# Feature scaling?
from sklearn.preprocessing import StandardScaler as skl_ss
ind_var = skl_ss().fit_transform(ind_var.astype(float))

# Split the dataset into test and train sets
from sklearn.model_selection import train_test_split as skl_tts
ind_train_set, ind_test_set, dep_train_set, dep_test_set = skl_tts(
    ind_var, dep_var, test_size=0.25)

# Fit the model
from sklearn.naive_bayes import GaussianNB as skl_gn
classifier = skl_gn()
classifier.fit(ind_train_set, dep_train_set)

# Predict the test set
prediction = classifier.predict(ind_test_set)

# Create confusion matrix to verify the results
# Check for categotical/hierarchical parameters
# No categorical neither hierarchical parameters, but the first two
# features are futile for this model.
dataset = dataset.iloc[:, 2:dataset.shape[1]]

# Split the dataset into independent matrix and
# dependent array (python's way of machine learning)
ind_param = dataset.iloc[:, :-1].values
dep_param = dataset.iloc[:, -1].values

# Feature scaling
# Random forest is not a distance-based algorithm, so it does not
# demand feature scaling.
from sklearn.preprocessing import StandardScaler as skl_ss
ind_param = skl_ss().fit_transform(ind_param.astype(float))

# Split the dataset into train and test sets
from sklearn.model_selection import train_test_split as skl_tts
ind_train_set, ind_test_set, dep_train_set, dep_test_set = skl_tts(
    ind_param, dep_param, test_size=0.25)

# Fit the model
from sklearn.ensemble import RandomForestClassifier as skl_rfc
classifier = skl_rfc(n_estimators=1000, criterion='entropy')
classifier.fit(ind_train_set, dep_train_set)

# Predict the test set
predictions = classifier.predict(ind_test_set)

# Confusion matrix