This file contains 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
model = Sequential() | |
# Tier one | |
model.add(Conv2D(32, kernel_size=5, input_shape = (28, 28, 1), activation='relu', padding = 'Same' )) | |
model.add(Conv2D(64, kernel_size=5, activation='relu')) | |
model.add(BatchNormalization()) | |
model.add(MaxPooling2D(pool_size = (2, 2))) | |
model.add(Dropout(0.33)) | |
model.add(Conv2D(128, kernel_size=3, activation='relu')) | |
model.add(Conv2D(256, kernel_size=3, activation = 'relu')) |
This file contains 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
from sklearn.tree import DecisionTreeClassifier | |
myClassifier2 = DecisionTreeClassifier(max_depth = 5, min_samples_leaf = 2) | |
myClassifier2.fit(X_train, y_train) | |
predictions2 = myClassifier2.predict(X_test) | |
cnf2 = confusion_matrix(y_test, predictions2) | |
score2 = accuracy_score(y_test, predictions2) | |
print ("Confusion Matrix for our Decision Tree classifier is :\n ", cnf2) |
This file contains 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
# Importing the tasty stuff | |
from sklearn.model_selection import train_test_split | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.metrics import confusion_matrix | |
from sklearn.externals import joblib | |
X = finalDf['size_in_mb'] | |
y = finalDf['pop_categories'] |
This file contains 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
A warning occurred (42 apples) | |
An error occurred |
NewerOlder