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
#Google Colab | |
!wget http://files.grouplens.org/datasets/movielens/ml-100k.zip | |
!unzip ml-100k.zip | |
#Importaciones | |
import torch | |
import numpy as np | |
import pandas as pd | |
import torch.nn as nn | |
import torch.nn.parallel | |
import torch.optim as optim |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 tensorflow.keras.preprocessing.image import ImageDataGenerator | |
#Definir Datagens | |
train_data_gen = ImageDataGenerator( | |
rescale = 1./255, #Normalizacion para que los valores de las imagenes para que queden entre 0 y 1 | |
shear_range = 0.2, #Direccion de rotacion contrareloj | |
zoom_range = 0.2, #Aplicacion de zoom aleatorio | |
horizontal_flip = True # Va a invertir horizontalmente la imagen aleatoriamente | |
) | |
test_datagen = ImageDataGenerator( |
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 tensorflow.keras.models import Sequential | |
from tensorflow.keras.layers import Convolution2D, MaxPooling2D, Flatten, Dense | |
model = Sequential() | |
model.add(Convolution2D(128, (3, 3), strides=(1,1), input_shape=(64,64,3), activation='relu')) | |
model.add(MaxPooling2D(pool_size=(2,2))) | |
model.add(Convolution2D(64, (3,3), strides=(1,1), activation='relu')) | |
model.add(MaxPooling2D(pool_size=(2,2))) | |
model.add(Flatten()) |
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
#Completo | |
#No ejecutar este codigo | |
#Solo por partes | |
from sklearn.model_selection import GridSearchCV | |
from tensorflow.keras.layers import Dropout | |
def build_model(optimizer): | |
model = Sequential() | |
model.add(Dense(32, input_shape=(X_train.shape[1],), activation='relu')) | |
model.add(Dropout(0.1)) |
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
import pandas as pd | |
from sklearn.preprocessing import OneHotEncoder, StandardScaler | |
from sklearn.compose import make_column_transformer, ColumnTransformer | |
from sklearn.model_selection import train_test_split | |
df = pd.read_csv('train.csv') | |
df.head() | |
df = df.dropna(subset=['Pclass', 'Sex', 'Age', 'Embarked', 'Fare', 'SibSp']) |
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
import numpy as np | |
def nonlin(x,deriv=False): | |
if(deriv==True): | |
return x*(1-x) | |
return 1/(1+np.exp(-x)) | |
X = np.array([[0,0,1], | |
[0,1,1], |
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
import numpy as np | |
def nonlin(x,deriv=False): | |
if(deriv==True): | |
return x*(1-x) | |
return 1/(1+np.exp(-x)) | |
X = np.array([[0,0,1], | |
[0,1,1], |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
De alguna manera, cada día usted forma parte de algún equipo. La pregunta no es: | |
«¿Participará en algo que involucre a otros?» La pregunta es: «¿Se involucrará con otros | |
para tener éxito?» La respuesta podrá encontrarla en este libro. | |
Todos sabemos que trabajar en equipo es algo bueno; más que bueno, ¡es esencial! | |
¿Pero cómo se logra esto? ¿Qué es lo que hace que un equipo tenga éxito? ¿Por qué | |
algunos equipos ascienden rápidamente a las cumbres más altas del éxito y ven cómo su | |
visión se hace realidad, mientras que otros parecen no ir a ninguna parte? | |
Estas son preguntas que no tienen una respuesta fácil. Si así fuera, los deportes | |
tendrían más campeones mundiales y la lista de las compañías de Fortuna 500 nunca |