Skip to content

Instantly share code, notes, and snippets.

View uds5501's full-sized avatar

Uddeshya Singh uds5501

View GitHub Profile
@uds5501
uds5501 / model.py
Created August 27, 2018 04:20
for fashion mnist blog
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'))
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)
@uds5501
uds5501 / refineData.py
Created July 18, 2018 07:34
for blog post 1
# 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']
@uds5501
uds5501 / foo.log
Created May 29, 2018 18:59 — forked from ibeex/foo.log
Flask logging example
A warning occurred (42 apples)
An error occurred