<jupyter_start><jupyter_text>Regularization Demo Ridge, Lasso y Elastic NetLos métodos de regularización son usados normalmente para reducir la dependencia de una variable independiente particular añadiendo una penalización a la función de coste (la que el algoritmo se encarga de minimizar), reduciendo así el temido *overfitting*. De este modo, se trata de evitar que los coeficientes de las variables independientes tomen valores extremos. 1. Cargamos librerías<jupyter_code>import pandas as pd
import numpy as np 
import matplotlib.pyplot as plt 
from sklearn import datasets 
from sklearn.model_selection import train_test_split 
from sklearn.linear_model import LinearRegression<jupyter_output><empty_output><jupyter_text>2. Vemos qué pinta tiene el dataset<jupyter_code># Loading pre-defined Boston Dataset 
boston_dataset = datasets.load_boston() 
print(boston_dataset.DESCR)<jupyter_output>.. _boston_dataset:

Boston house prices dataset
---------------------------

**Data Set Characteristics:**  

    :Number of Instances: 506 

    :Number of Attributes: 13 numeric/categorical predictive. Median Value (attribute 14) is usually the target.

    :Attribute Information (in order):
        - CRIM     per capita crime rate by town
        - ZN       proportion of residential land zoned for lots over 25,000 sq.ft.
        - INDUS    proportion of non-retail business acres per town
        - CHAS     Charles River dummy variable (= 1 if tract bounds river; 0 otherwise)
        - NOX      nitric oxides concentration (parts per 10 million)
        - RM       average number of rooms per dwelling
        - AGE      proportion of owner-occupied units built prior to 1940
        - DIS      weighted distances to five Boston employment centres
        - RAD      index of accessibility to radial highways
        - TAX      full-value property-tax rate per $10,000
        - PTRATIO  pu[...]<jupyter_text>3. Rápido análisis exploratorio para ver sus dependencias lineales<jupyter_code># Generate scatter plot of independent vs Dependent variable 
plt.style.use('ggplot') 
fig = plt.figure(figsize = (18, 18)) 
  
for index, feature_name in enumerate(boston_dataset.feature_names): 
    ax = fig.add_subplot(4, 4, index + 1) 
    ax.scatter(boston_dataset.data[:, index], boston_dataset.target) 
    ax.set_ylabel('House Price', size = 12) 
    ax.set_xlabel(feature_name, size = 12) 

plt.show()<jupyter_output><empty_output><jupyter_text>4. Preprocesado de los datos<jupyter_code># Load the dataset into Pandas Dataframe 
boston_pd = pd.DataFrame(boston_dataset.data) 
boston_pd.columns = boston_dataset.feature_names 
boston_pd_target = np.asarray(boston_dataset.target) 
boston_pd['House Price'] = pd.Series(boston_pd_target) 
  
# input  
X = boston_pd.iloc[:, :-1]

#output 
Y = boston_pd.iloc[:, -1] 
  
# print(boston_pd.head())

x_train, x_test, y_train, y_test = train_test_split(X, Y, test_size = 0.25, random_state=42)
  
print("Train data shape of X = % s and Y = % s : "%( 
    x_train.shape, y_train.shape)) 
  
print("Test data shape of X = % s and Y = % s : "%( 
    x_test.shape, y_test.shape))<jupyter_output>Train data shape of X = (379, 13) and Y = (379,) : 
Test data shape of X = (127, 13) and Y = (127,) :<jupyter_text>5. Regresión lineal múltiple<jupyter_code># Apply multiple Linear Regression Model 
lreg = LinearRegression() 
lreg.fit(x_train, y_train) 
  
# Generate Prediction on test set 
lreg_y_pred = lreg.predict(x_test)
# calculating Mean Squared Error (mse) 
mean_squared_error = np.mean((lreg_y_pred - y_test)**2) 
print("Mean squared Error on test set : ", mean_squared_error)
mean_squared_error
# Putting together the coefficient and their corrsponding variable names  
lreg_coefficient = pd.DataFrame() 
lreg_coefficient["Columns"] = x_train.columns 
lreg_coefficient['Coefficient Estimate'] = pd.Series(lreg.coef_) 

# Getting coefficients:
print(lreg_coefficient) 
lreg_y_pred = lreg.predict(x_train) 
mean_squared_error = np.mean((lreg_y_pred - y_train)**2) 
print("Mean squared Error on train set : ", mean_squared_error) 
print("Coeficientes:", lreg.coef_)
print("Interceptor:", lreg.intercept_)<jupyter_output>Coeficientes: [-1.28322638e-01  2.95517751e-02  4.88590934e-02  2.77350326e+00
 -1.62388292e+01  4.36875476e+00 -9.24808158e-03 -1.40086668e+00
  2.57761243e-01 -9.95694820e-03 -9.23122944e-01  1.31854199e-02
 -5.17639519e-01]
Interceptor: 29.836420163838405<jupyter_text>Pintamos los coeficientes para verlos mejor<jupyter_code># plotting the coefficient score 
fig, ax = plt.subplots(figsize =(20, 10)) 
  
color =['tab:gray', 'tab:blue', 'tab:orange',  
'tab:green', 'tab:red', 'tab:purple', 'tab:brown',  
'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan',  
'tab:orange', 'tab:green', 'tab:blue', 'tab:olive'] 
  
ax.bar(lreg_coefficient["Columns"],  
lreg_coefficient['Coefficient Estimate'],  
color = color) 
  
ax.spines['bottom'].set_position('zero') 
ax.set_ylim([-19,4])
  
plt.style.use('ggplot');<jupyter_output><empty_output><jupyter_text>6. Ridge regressionLa regresión Ridge añade a la función de coste una penalización de regularización L2, lo que reduce los valores de los coeficientes drásticamente. No llega a eliminar estos coeficientes completamente, pero sí que permite medir el impacto de diferentes variables independientes:<jupyter_code># Load the dataset into Pandas Dataframe 
boston_pd = pd.DataFrame(boston_dataset.data) 
boston_pd.columns = boston_dataset.feature_names 
boston_pd_target = np.asarray(boston_dataset.target) 
boston_pd['House Price'] = pd.Series(boston_pd_target) 
  
# input  
X = boston_pd.iloc[:, :-1] 
  
#output 
Y = boston_pd.iloc[:, -1] 
  
# print(boston_pd.head())

x_train, x_test, y_train, y_test = train_test_split(X, Y, test_size = 0.25, random_state=42)
  
print("Train data shape of X = % s and Y = % s : "%( 
    x_train.shape, y_train.shape)) 
  
print("Test data shape of X = % s and Y = % s : "%( 
    x_test.shape, y_test.shape)) 
# import ridge regression from sklearn library 
from sklearn.linear_model import Ridge
  
# Train the model  
ridgeR = Ridge(alpha = 1)
ridgeR.fit(x_train, y_train) 
y_pred = ridgeR.predict(x_test)
y_pred
# calculate mean square error 
mean_squared_error_ridge = np.mean((y_pred - y_test)**2) 
print(mean_squared_error_ridge)
# get ridge coefficient and print them 
ridge_coefficient = pd.DataFrame() 
ridge_coefficient["Columns"]= x_train.columns 
ridge_coefficient['Coefficient Estimate'] = pd.Series(ridgeR.coef_) 
print(ridge_coefficient) 
print("Coeficientes:", ridgeR.coef_)
print("Interceptor:", ridgeR.intercept_)<jupyter_output>Coeficientes: [-0.12383039  0.03139178  0.01767668  2.54277179 -8.77249222  4.37980204
 -0.01537349 -1.29086084  0.24406848 -0.01082435 -0.83346553  0.01348642
 -0.53435396]
Interceptor: 24.87837047296951<jupyter_text>Veamos en la gráfica cómo quedaría para alpha = 1<jupyter_code># plotting the coefficient score 
fig, ax = plt.subplots(figsize =(20, 10)) 
  
color =['tab:gray', 'tab:blue', 'tab:orange',  
'tab:green', 'tab:red', 'tab:purple', 'tab:brown',  
'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan',  
'tab:orange', 'tab:green', 'tab:blue', 'tab:olive'] 
  
ax.bar(ridge_coefficient["Columns"],  
ridge_coefficient['Coefficient Estimate'],  
color = color) 
  
ax.spines['bottom'].set_position('zero') 
ax.set_ylim([-19,4])
  
plt.style.use('ggplot') 
plt.show()<jupyter_output><empty_output><jupyter_text>Si hacemos ahora alpha = 10<jupyter_code># Train the model  
ridgeR = Ridge(alpha = 100) 
ridgeR.fit(x_train, y_train) 
y_pred = ridgeR.predict(x_test) 

# calculate mean square error 
mean_squared_error_ridge = np.mean((y_pred - y_test)**2) 
print(mean_squared_error_ridge)
# get ridge coefficient and print them 
ridge_coefficient = pd.DataFrame() 
ridge_coefficient["Columns"]= x_train.columns 
ridge_coefficient['Coefficient Estimate'] = pd.Series(ridgeR.coef_) 
print(ridge_coefficient)

# plotting the coefficient score 
fig, ax = plt.subplots(figsize =(20, 10)) 
  
color =['tab:gray', 'tab:blue', 'tab:orange',  
'tab:green', 'tab:red', 'tab:purple', 'tab:brown',  
'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan',  
'tab:orange', 'tab:green', 'tab:blue', 'tab:olive'] 
  
ax.bar(ridge_coefficient["Columns"],  
ridge_coefficient['Coefficient Estimate'], color = color) 
  
ax.spines['bottom'].set_position('zero') 
ax.set_ylim([-18,4])
  
plt.style.use('ggplot') 
plt.show()<jupyter_output>Columns  Coefficient Estimate
0      CRIM             -0.124096
1        ZN              0.038237
2     INDUS             -0.034836
3      CHAS              0.553359
4       NOX             -0.170648
5        RM              2.338971
6       AGE             -0.002521
7       DIS             -1.076123
8       RAD              0.290950
9       TAX             -0.013855
10  PTRATIO             -0.814406
11        B              0.012933
12    LSTAT             -0.700810<jupyter_text>7. Lasso regressionLa regresión Lasso utiliza una penalización de regularización L1, lo cual no es que reduzca el valor de los coeficientes como la regresión Ridge, sino que llega a eliminar aquellos que tienen un impacto menor (si lo tienen) en la predicción. Se usa en algunos casos como selector de variables (feature selection), que será un tema que veremos en el futuro con un poco más de detalle.<jupyter_code># Load the dataset into Pandas Dataframe 
boston_pd = pd.DataFrame(boston_dataset.data) 
boston_pd.columns = boston_dataset.feature_names 
boston_pd_target = np.asarray(boston_dataset.target) 
boston_pd['House Price'] = pd.Series(boston_pd_target) 

# input  
X = boston_pd.iloc[:, :-1] 
  
#output 
Y = boston_pd.iloc[:, -1] 
  
# print(boston_pd.head())

x_train, x_test, y_train, y_test = train_test_split(X, Y, test_size = 0.25, random_state=42)
  
print("Train data shape of X = % s and Y = % s : "%( 
    x_train.shape, y_train.shape)) 
  
print("Test data shape of X = % s and Y = % s : "%( 
    x_test.shape, y_test.shape)) 
# import Lasso regression from sklearn library 
from sklearn.linear_model import Lasso 
  
# Train the model 
lasso = Lasso(alpha = .05)
lasso.fit(x_train, y_train) 
y_pred1 = lasso.predict(x_test) 
  
# Calculate Mean Squared Error 
mean_squared_error = np.mean((y_pred1 - y_test)**2) 
print("Mean squared error on test set", mean_squared_error) 
lasso_coeff = pd.DataFrame() 
lasso_coeff["Columns"] = x_train.columns 
lasso_coeff['Coefficient Estimate'] = pd.Series(lasso.coef_) 
  
print(lasso_coeff) 

# plotting the coefficient score 
fig, ax = plt.subplots(figsize =(20, 10)) 
  
color =['tab:gray', 'tab:blue', 'tab:orange',  
'tab:green', 'tab:red', 'tab:purple', 'tab:brown',  
'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan',  
'tab:orange', 'tab:green', 'tab:blue', 'tab:olive'] 
  
ax.bar(lasso_coeff["Columns"],  
lasso_coeff['Coefficient Estimate'],  
color = color) 
  
ax.spines['bottom'].set_position('zero') 
ax.set_ylim([-18,4])
  
plt.style.use('ggplot')
# import Lasso regression from sklearn library 
from sklearn.linear_model import Lasso 
  
# Train the model 
lasso = Lasso(alpha = 0.05) 
lasso.fit(x_train, y_train) 
y_pred1 = lasso.predict(x_test) 
  
# Calculate Mean Squared Error 
mean_squared_error = np.mean((y_pred1 - y_test)**2) 
print("Mean squared error on test set", mean_squared_error) 
lasso_coeff = pd.DataFrame() 
lasso_coeff["Columns"] = x_train.columns 
lasso_coeff['Coefficient Estimate'] = pd.Series(lasso.coef_) 
  
print(lasso_coeff) 

# plotting the coefficient score 
fig, ax = plt.subplots(figsize =(20, 10)) 
  
color =['tab:gray', 'tab:blue', 'tab:orange',  
'tab:green', 'tab:red', 'tab:purple', 'tab:brown',  
'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan',  
'tab:orange', 'tab:green', 'tab:blue', 'tab:olive'] 
  
ax.bar(lasso_coeff["Columns"],  
lasso_coeff['Coefficient Estimate'],  
color = color) 
  
ax.spines['bottom'].set_position('zero')
ax.set_ylim([-18,4])
  
plt.style.use('ggplot')
X['NOX'].describe()<jupyter_output><empty_output><jupyter_text>8. Elastic NetElastic Net, por su parte, combina las 2 regularizaciones que hemos visto anteriormente: Ridge y Lasso. ¿Cómo lo hace? Pues añadiendo las dos penalizaciones que añaden cada una de ellas a su función de coste. En la mayoría de casos, gracias a esta combinación, funciona mejor que las ya mencionadas regresiones Ridge y Lasso:<jupyter_code># import model 
from sklearn.linear_model import ElasticNet 
  
# Train the model 
e_net = ElasticNet(l1_ratio=0.9) 
e_net.fit(x_train, y_train) 
  
# calculate the prediction and mean square error 
y_pred_elastic = e_net.predict(x_test) 
mean_squared_error = np.mean((y_pred_elastic - y_test)**2) 
print("Mean Squared Error on test set", mean_squared_error) 
  
e_net_coeff = pd.DataFrame() 
e_net_coeff["Columns"] = x_train.columns 
e_net_coeff['Coefficient Estimate'] = pd.Series(e_net.coef_) 
e_net_coeff 
# plotting the coefficient score 
fig, ax = plt.subplots(figsize =(20, 10)) 
  
color =['tab:gray', 'tab:blue', 'tab:orange',  
'tab:green', 'tab:red', 'tab:purple', 'tab:brown',  
'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan',  
'tab:orange', 'tab:green', 'tab:blue', 'tab:olive'] 
  
ax.bar(e_net_coeff["Columns"],  
e_net_coeff['Coefficient Estimate'],  
color = color) 
  
ax.spines['bottom'].set_position('zero') 
  
plt.style.use('ggplot') 
plt.show()<jupyter_output><empty_output><jupyter_text>*¡Spoiler Alert!*Y para rematar... Tenemos la guinda del pastel. No lo veremos aún pero es una de las cosas divertidas que haremos en el futuro: ¡¡GridSearch!! O lo que es lo mismo, dejar que la máquine pruebe valores por nosotros de forma iterativa para obtener los mejores resultados:<jupyter_code>np.linspace(0, 0.05, 50)
from sklearn.model_selection import GridSearchCV

# define model
model = ElasticNet()
# define grid
grid = dict()
grid['alpha'] = [1e-4, 1e-3, 1e-2, 1e-1, 0.0, 1.0, 10.0, 100.0]
grid['l1_ratio'] = np.arange(0, 1, 0.1)
# define search
search = GridSearchCV(model, grid, scoring='neg_mean_squared_error', cv=10, n_jobs=-1)
# perform the search
results = search.fit(x_train, y_train)

# summarize
print('MSE: %.3f' % results.best_score_)
print('Config: %s' % results.best_params_)
-results.best_score_<jupyter_output><empty_output><jupyter_text>EJERCICIO1. Lee el dataframe de los futbolistas e intenta predecir el 'value_eur' con un algoritmo lineal2. Ahora prueba con los 3 métodos que acabamos de ver, ¿con cuál obtienes mejor resultado? ¿Qué variables has utilizado? ¿Has convertido alguna categórica? Compara tus resultados con tus compañeros de clase.EXTRA: ¿Recuerdas algún ejercicio donde hayas utilizado un regresor lineal y hayas tenido problemas de overfitting? Prueba a utilizar alguno de estos métodos y comprueba el resultado.<jupyter_code>df = pd.read_csv("../../../data/FIFA20.csv")
df
df = pd.read_csv("../../../data/FIFA20.csv")
df['year'] = df['dob'].apply(lambda x: x[:4]).astype(int)
df['month'] = df['dob'].apply(lambda x: x[5:7]).astype(int)
df['day'] = df['dob'].apply(lambda x: x[8:]).astype(int)
# df['position_aux'] = df['team_position'].apply(lambda x: agrupa(x))
df['position_aux'] = df['team_position']\
    .apply(lambda x: 
           'Delantero' if x == 'CF' else (
               'Extremo' if (x == 'LW' or x == 'RW') else (
                   'Suplente' if x == 'SUB' else (
                       'Reserva' if x == 'RES' else 'Otros'))))
df
position_dummies = pd.get_dummies(df['position_aux'], prefix='pos')
position_dummies
df = df.join(position_dummies)
['year', 'overall', 'potencial', 'wage_eur'] + list(position_dummies.columns)
X = df.copy()[['year', 'month', 'day', 'overall', 'potential', 'wage_eur'] + list(position_dummies.columns)]
Y = df['value_eur']
modelo_lineal = LinearRegression()
x_train, x_test, y_train, y_test = train_test_split(X, Y, test_size = 0.25, random_state=42)
modelo_lineal.fit(x_train, y_train)
modelo_lineal.score(x_train, y_train)
modelo_lineal.score(x_test, y_test)
import statsmodels.formula.api as sm
f"""Q('{y_train.name}')~{'+'.join(["Q('"+col+"')" for col in x_train.columns])}"""
model = sm.ols(formula=f"""Q('{y_train.name}')~{'+'.join(["Q('"+col+"')" for col in x_train.columns])}""", data = boston_pd).fit()
model.summary()
# import Lasso regression from sklearn library 
from sklearn.linear_model import Lasso 
  
# Train the model 
lasso = Lasso(alpha = 1, random_state=42, max_iter=10000) 
lasso.fit(x_train, y_train) 
y_pred1 = lasso.predict(x_test) 
  
# Calculate Mean Squared Error 
mean_squared_error = np.mean((y_pred1 - y_test)**2) 
print("Mean squared error on test set", mean_squared_error) 
lasso_coeff = pd.DataFrame() 
lasso_coeff["Columns"] = x_train.columns 
lasso_coeff['Coefficient Estimate'] = pd.Series(lasso.coef_) 
  
print(lasso_coeff) 

# plotting the coefficient score 
fig, ax = plt.subplots(figsize =(20, 10)) 
  
color =['tab:gray', 'tab:blue', 'tab:orange',  
'tab:green', 'tab:red', 'tab:purple', 'tab:brown',  
'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan',  
'tab:orange', 'tab:green', 'tab:blue', 'tab:olive'] 
  
ax.bar(lasso_coeff["Columns"],  
lasso_coeff['Coefficient Estimate'],  
color = color) 
  
ax.spines['bottom'].set_position('zero')
  
plt.style.use('ggplot')
from sklearn.linear_model import ElasticNet
from sklearn.preprocessing import StandardScaler

scaler = StandardScaler()
scaler.fit(x_train)

x_train_scaled = scaler.transform(x_train)
x_test_scaled = scaler.transform(x_test)

# elastic = ElasticNet(alpha=0.05, l1_ratio=0.9)

# elastic.fit(x_train_scaled, y_train)
# import Lasso regression from sklearn library 
from sklearn.linear_model import Lasso 
  
# Train the model 
lasso = Lasso(alpha = 1, random_state=42, max_iter=100) 
lasso.fit(x_train_scaled, y_train) 
y_pred1 = lasso.predict(x_test_scaled) 
  
# Calculate Mean Squared Error 
mean_squared_error = np.mean((y_pred1 - y_test2)**2) 
print("Mean squared error on test set", mean_squared_error) 
lasso_coeff = pd.DataFrame() 
lasso_coeff["Columns"] = x_train2.columns 
lasso_coeff['Coefficient Estimate'] = pd.Series(lasso.coef_) 
  
print(lasso_coeff) 

# plotting the coefficient score 
fig, ax = plt.subplots(figsize =(20, 10)) 
  
color =['tab:gray', 'tab:blue', 'tab:orange',  
'tab:green', 'tab:red', 'tab:purple', 'tab:brown',  
'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan',  
'tab:orange', 'tab:green', 'tab:blue', 'tab:olive'] 
  
ax.bar(lasso_coeff["Columns"],  
lasso_coeff['Coefficient Estimate'],  
color = color) 
  
ax.spines['bottom'].set_position('zero')
  
plt.style.use('ggplot')
y_predictions = pd.DataFrame(y_test).copy()
y_predictions['pred'] = y_pred1
y_predictions = y_predictions.sort_values(by='value_eur')
plt.plot(y_predictions['value_eur'], y_predictions['pred'])
from sklearn.linear_model import ElasticNet
from sklearn.preprocessing import StandardScaler

scaler = StandardScaler()
scaler.fit(x_train)

# x_train_scaled = scaler.transform(x_train)
# x_test_scaled = scaler.transform(x_test)

# elastic = ElasticNet(alpha=0.05, l1_ratio=0.9)

# elastic.fit(x_train_scaled, y_train)
# import Lasso regression from sklearn library 
from sklearn.linear_model import Lasso 
  
# Train the model 
lasso = Lasso(alpha = 0, random_state=42, max_iter=100) 
lasso.fit(x_train, y_train)
y_pred1 = lasso.predict(x_test) 
  
# Calculate Mean Squared Error 
mean_squared_error = np.mean((y_pred1 - y_test2)**2) 
print("Mean squared error on test set", mean_squared_error) 
lasso_coeff = pd.DataFrame()
lasso_coeff["Columns"] = x_train.columns 
lasso_coeff['Coefficient Estimate'] = pd.Series(lasso.coef_) 
  
print(lasso_coeff) 

# plotting the coefficient score 
fig, ax = plt.subplots(figsize =(20, 10)) 
  
color =['tab:gray', 'tab:blue', 'tab:orange',  
'tab:green', 'tab:red', 'tab:purple', 'tab:brown',  
'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan',  
'tab:orange', 'tab:green', 'tab:blue', 'tab:olive'] 
  
ax.bar(lasso_coeff["Columns"],  
lasso_coeff['Coefficient Estimate'],  
color = color) 
  
ax.spines['bottom'].set_position('zero')
  
plt.style.use('ggplot')<jupyter_output><ipython-input-444-9f0226d7ed42>:6: UserWarning: With alpha=0, this algorithm does not converge well. You are advised to use the LinearRegression estimator
  lasso.fit(x_train, y_train)
C:\Users\TheBridge\anaconda3\lib\site-packages\sklearn\linear_model\_coordinate_descent.py:529: UserWarning: Coordinate descent with no regularization may lead to unexpected results and is discouraged.
  model = cd_fast.enet_coordinate_descent(
C:\Users\TheBridge\anaconda3\lib\site-packages\sklearn\linear_model\_coordinate_descent.py:529: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 4.432416138021491e+16, tolerance: 42775703485740.266
  model = cd_fast.enet_coordinate_descent(
{'fraction_non_alphanumeric': 0.1321966769706337, 'fraction_numerical': 0.03438948995363215, 'mean_word_length': 4.732281284606866, 'pattern_counts': {'":': 0, '<': 48, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '13', 'dir': 'jupyter-structured-clean-dedup', 'id': '116331', 'license': 'MIT', 'n_tokens_mistral': 8277, 'n_tokens_neox': 7592, 'n_words': 1779, 'path': 'Bloque 3 - Machine Learning/01_Supervisado/3-Regularizacion/01_Regularization.ipynb', 'repo_name': 'franciscocanon-thebridge/bootcamp_thebridge_PTSep20', 'size': '20704'}