This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://jakevdp.github.io/PythonDataScienceHandbook/05.08-random-forests.html | |
# | |
def visualize_classifier(model, X, y, ax=None, cmap='rainbow'): | |
ax = ax or plt.gca() | |
# Plot the training points | |
ax.scatter(X[:, 0], X[:, 1], c=y, s=30, cmap=cmap, | |
clim=(y.min(), y.max()), zorder=3) | |
ax.axis('tight') | |
ax.axis('off') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Preliminary investigation | |
# Shape of training data (num_rows, num_columns) | |
print(X_train.shape) | |
# Number of missing values in each column of training data | |
missing_val_count_by_column = (X_train.isnull().sum()) | |
print(missing_val_count_by_column[missing_val_count_by_column > 0]) | |
# Result | |
''' |
NewerOlder