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
# MLP for Pima Indians Dataset with 10-fold cross validation | |
from keras.models import Sequential | |
from keras.layers import Dense | |
from sklearn.model_selection import StratifiedKFold | |
import numpy | |
# fix random seed for reproducibility | |
seed = 7 | |
numpy.random.seed(seed) | |
# load pima indians dataset |
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
# MLP with manual validation set | |
from keras.models import Sequential | |
from keras.layers import Dense | |
from sklearn.model_selection import train_test_split | |
import numpy as np | |
# fix random seed for reproducibility | |
seed = 7 | |
np.random.seed(seed) | |
# load pima indians dataset |
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
# MLP with manual validation set | |
from keras.models import Sequential | |
from keras.layers import Dense | |
from sklearn.model_selection import train_test_split | |
import numpy as np | |
# fix random seed for reproducibility | |
seed = 7 | |
np.random.seed(seed) | |
# load pima indians dataset |
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
# Create your first MLP in Keras | |
from keras.models import Sequential | |
from keras.layers import Dense | |
import numpy | |
FILENAME = '../data/pima-indians-diabetes.csv' | |
# Fix random seed for reproducibility. | |
seed = 7 | |
numpy.random.seed(seed) |
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
scores = model.evaluate(X, Y) | |
print("%s: %.2f%%" % (model.metrics_names[1], scores[1]*100)) |
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.fit(X, Y, nb_epoch=150, batch_size=10) |
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.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy']) |
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() | |
model.add(Dense(12, input_dim=8, init='uniform', activation='relu')) | |
model.add(Dense(8, init='uniform', activation='relu')) | |
model.add(Dense(1, init='uniform', activation='sigmoid')) |
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 keras.models import Sequential | |
from keras.layers import Dense | |
import numpy | |
seed = 7 | |
numpy.random.seed(seed) | |
# Cargar el dataset de los indios Pima. | |
dataset = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=",") |
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
"""Extract important information from AppAnnie via API.""" | |
import pandas as pd | |
from absl import app | |
from absl import flags | |
from absl import logging | |
from bs4 import BeautifulSoup as BS | |
from collections import namedtuple | |
from retrying import retry |
NewerOlder