import h5py
from functools import reduce
def hdf5(path, data_key = "data", target_key = "target", flatten = True):
with h5py.File(path, 'r') as hf:
train = hf.get('train')
X_tr = train.get(data_key)[:]
y_tr = train.get(target_key)[:]
test = hf.get('test')
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
| import os | |
| import urllib.request | |
| import tarfile | |
| import glob | |
| import random | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from PIL import Image | |
| # ============================================================================== |
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
| import os | |
| import urllib.request | |
| import tarfile | |
| import random | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from PIL import Image | |
| from pathlib import Path | |
| # ============================================================================== |
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
| # La definicion de una clase en Python sigue la siguiente forma : | |
| class NombreDeClase(ClasePadre1, ClasePadre2, ...): | |
| """ | |
| Docstring que sirve para describir la clase | |
| """ | |
| atributo_de_clase = valor | |
| otro_atributo_de_clase = peso | |
| otro_atributo_mas_de_clase = estatura |
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
| # modulos | |
| import os | |
| import numpy as np | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| import seaborn as sns | |
| # Limpieza de disco duro | |
| os.system("rm -Rf *.zip") | |
| os.system("rm -Rf *.csv") | |
| # sklearn |
# Punto de Partida de la sesion 7
import requests
# Punto de Partida de la sesion 6
url = "https://gist.githubusercontent.com/robintux/fe4a2db377bc11724bf91d4103eabdc0/raw/0abef25aa34b7348242bd6887413fe47fc03952d/inicio_sesion6_EPC_DL20206.py"
response = requests.get(url)
# Verifiquemos que la descarga fue exitosa
1. **Distancia entre dos puntos aleatorios en el plano**
Genera dos puntos `(x1, y1)` y `(x2, y2)` con coordenadas enteras aleatorias entre -10 y 10. Calcula la distancia euclidiana entre ellos usando `math.hypot()` o `math.sqrt`. Muestra la distancia redondeada a 2 decimales.
2. **Área de un triángulo con lados aleatorios válidos**
Genera tres números aleatorios reales entre 1 y 20 (usa `random.uniform`). Usa la fórmula de Herón para calcular el área. No verifiques si forman triángulo (asume que sí). Usa `math.sqrt`. Muestra el área.
3. **Volumen de una esfera con radio aleatorio**
### Ejemplitos
1. **Compra con descuento y posterior impuesto**
Un producto cuesta $250. Aplican un descuento del 15%, pero luego sobre el precio con descuento se añade un impuesto del 12%. Calcula el precio final. Luego, determina qué porcentaje del precio original representa el precio final.
2. **Promedio ponderado inverso**
# =============================================================================
# 1. DEFINICIÓN DE CONFIGURACIONES A EXPERIMENTAR
# =============================================================================
experiment_configs = [
# Configuración 1: Línea Base (Baseline)
# Objetivo: Establecer un punto de referencia mínimo viable sin trucos.
{
"name": "Baseline_ReLU",
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
| # Practicas Estandar | |
| # Gestion del sistema de archivos en python | |
| import os | |
| import sys | |
| import shutil | |
| from pathlib import Path | |
| # Modulos Cientificos | |
| import numpy as np | |
| import pandas as pd |
NewerOlder