<jupyter_start><jupyter_text>Import<jupyter_code>import dill
import numpy as np
import pandas as pd

pd.set_option("display.max_columns", None)

import plotly.graph_objects as go
import matplotlib.pyplot as plt
import seaborn as sns

from src.models.logistic_regression import ModelLogisticRegression
import src.models.performance_metrics as performance_metrics<jupyter_output><empty_output><jupyter_text>Dataset<jupyter_code>with open(path_dataset_train, "rb") as input_file:
    dataset_train = dill.load(input_file)<jupyter_output><empty_output><jupyter_text>Overall<jupyter_code>model = ModelLogisticRegression()
model.version
dataset_train = model.preprocessing_training(dataset_train)
model.train(dataset_train)
model.plot_coefficients()
with open(f"models/{model.version}__model.pkl", "wb") as file:
    dill.dump(model, file)<jupyter_output><empty_output><jupyter_text>Data Transformation<jupyter_code>vardict.keys()<jupyter_output><empty_output><jupyter_text>Target<jupyter_code>dataset_train[model.vardict["target"]].describe()<jupyter_output><empty_output><jupyter_text>Numerical<jupyter_code>dataset_train[vardict["numerical"]].isnull().sum()
def data_transform_numerical(dataset, vardict):

    dataset["previous_levenshtein_distance_guess_answer"].fillna(-1, inplace=True)
    dataset["previous_question_time"].fillna(-1, inplace=True)
    dataset["previous_write_it_again_german"].fillna(-1, inplace=True)
    dataset["previous_write_it_again_english"].fillna(-1, inplace=True)

    return dataset, vardict<jupyter_output><empty_output><jupyter_text>Diff time<jupyter_code>dataset_train[vardict["diff_time"]].isnull().sum()
def data_transform_diff_time(dataset, vardict):

    dataset["days_since_last_occurrence_same_language"].fillna(-1, inplace=True)
    dataset["days_since_last_occurrence_any_language"].fillna(-1, inplace=True)
    dataset["days_since_last_success_same_language"].fillna(-1, inplace=True)
    dataset["days_since_last_success_any_language"].fillna(-1, inplace=True)
    dataset["days_since_first_occur_same_language"].fillna(-1, inplace=True)
    dataset["days_since_first_occur_any_language"].fillna(-1, inplace=True)

    return dataset, vardict<jupyter_output><empty_output><jupyter_text>Boolean<jupyter_code>dataset_train[vardict["boolean"]]
def data_transform_boolean(dataset, vardict):

    # Transform to dummies

    vardict["dummy_boolean"] = []

    for i_var_boolean in vardict["boolean"]:

        # possible improvement: pandas.get_dummies(drop_first=False)
        i_dummy_boolean = pd.get_dummies(
            dataset[i_var_boolean],
            prefix=i_var_boolean,
            prefix_sep="__",
            dummy_na=True,
        )

        del dataset_train[i_var_boolean]

        vardict["dummy_boolean"] = (
            vardict["dummy_boolean"] + i_dummy_boolean.columns.tolist()
        )

        dataset = pd.concat([dataset, i_dummy_boolean], axis=1)

    dataset[vardict["dummy_boolean"]].describe()

    return dataset, vardict<jupyter_output><empty_output><jupyter_text>Categorical<jupyter_code>dataset_train[model.vardict["categorical"]]["previous_language_asked"].value_counts()
def data_transform_categorical(dataset, vardict):

    # Transform to dummies

    vardict["dummy_categorical"] = []

    for i_var_categorical in vardict["categorical"]:

        # possible improvement: pandas.get_dummies(drop_first=False)
        i_dummy_categorical = pd.get_dummies(
            dataset[i_var_categorical],
            prefix=i_var_categorical,
            prefix_sep="__",
            dummy_na=True,
        )

        del dataset[i_var_categorical]

        vardict["dummy_categorical"] = (
            vardict["dummy_categorical"] + i_dummy_categorical.columns.tolist()
        )

        dataset = pd.concat([dataset, i_dummy_categorical], axis=1)

    return dataset, vardict<jupyter_output><empty_output><jupyter_text>Overall<jupyter_code>dataset_train, vardict = data_transform_numerical(dataset_train, vardict)
dataset_train, vardict = data_transform_diff_time(dataset_train, vardict)
dataset_train, vardict = data_transform_boolean(dataset_train, vardict)
dataset_train, vardict = data_transform_categorical(dataset_train, vardict)<jupyter_output><empty_output><jupyter_text>vardict<jupyter_code>vardict["all"] = (
    vardict["numerical"]
    + vardict["diff_time"]
    + vardict["dummy_boolean"]
    + vardict["dummy_categorical"]
)<jupyter_output><empty_output><jupyter_text>1st model<jupyter_code>model = ModelLogisticRegression()
model.version
dataset_train = model.preprocessing_training(dataset_train)
dataset = dataset_train.copy()
X_train = dataset[model.vardict["into_model"]]
y_train = dataset[model.vardict["target"]]
from sklearn.pipeline import Pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.linear_model import LogisticRegression

logistic_Reg = LogisticRegression(solver="liblinear")
pipe = Pipeline(steps=[("logistic_Reg", logistic_Reg)])
C = np.logspace(-4, 4, 50)
penalty = ["l1", "l2"]
parameters = dict(logistic_Reg__C=C, logistic_Reg__penalty=penalty)
clf_GS = GridSearchCV(pipe, parameters)
clf_GS.fit(X_train, y_train)
print("Best Penalty:", clf_GS.best_estimator_.get_params()["logistic_Reg__penalty"])
print("Best C:", clf_GS.best_estimator_.get_params()["logistic_Reg__C"])
print()
print(clf_GS.best_estimator_.get_params()["logistic_Reg"])
os = SMOTE(random_state=0)
X_train = dataset[model.vardict["all"]]
y_train = dataset[[model.vardict["target"]]]
X_train_os, y_train_os_series = os.fit_sample(X_train, y_train)
y_train_os = pd.DataFrame()
y_train_os[model.vardict["target"]] = y_train_os_series
dataset = pd.concat([X_train_os, y_train_os], axis=1)

y_train_os_series
from imblearn.over_sampling import SMOTE
os = SMOTE(random_state=0)
len(X_train)
X_train_os, y_train_os = os.fit_sample(X_train, y_train)
y_train_os
dataset_test2 = pd.concat([X_train_os, y_train_os], axis=0)
dataset_test2
len(X_train_os)
y_train_os
os_data_X = pd.DataFrame(data=X_train_os, columns=X_train.columns)
os_data_y = pd.DataFrame()
os_data_y["y"] = y_train_os
os_data_y
# we can Check the numbers of our data
print("length of oversampled data is ", len(os_data_X))
print(
    "Number of no subscription in oversampled data", len(os_data_y[os_data_y["y"] == 0])
)
print("Number of subscription", len(os_data_y[os_data_y["y"] == 1]))
print(
    "Proportion of no subscription data in oversampled data is ",
    len(os_data_y[os_data_y["y"] == 0]) / len(os_data_X),
)
print(
    "Proportion of subscription data in oversampled data is ",
    len(os_data_y[os_data_y["y"] == 1]) / len(os_data_X),
)
X_train
y_train
model = LogisticRegression(random_state=0)
model.fit(X_train, y_train)
with open(f"data/processed/{model_name}_model.pkl", "wb") as file:
    dill.dump(model, file)

with open(f"data/processed/{model_name}_vardict.pkl", "wb") as file:
    dill.dump(vardict, file)<jupyter_output><empty_output><jupyter_text>Validation results<jupyter_code>with open(path_dataset_valid, "rb") as input_file:
    dataset_valid = dill.load(input_file)
model.predict_and_show_results(dataset_valid, save_folder="data/pipeline/20201024")
with open(path_dataset_valid, "rb") as input_file:
    dataset_valid = dill.load(input_file)

y_valid = dataset_valid[model.vardict["target"]].copy()
dataset_valid = model.preprocessing_inference(dataset_valid)
predictions = model.predict(dataset=dataset_valid, target_present=False)
predictions["y_true"] = y_valid.values.tolist()
predictions
binary_classification_results = performance_metrics.get_binary_classification_results(
    predictions, model_name=f"{model.version}_valid"
)

binary_classification_results
regression_results = performance_metrics.get_regression_results(
    predictions, model_name=f"{model.version}_valid"
)

regression_results
performance_metrics.plot_roc_auc_curve(predictions, model_name=f"{model.version}_valid")
performance_metrics.plot_precision_recall_curve(
    predictions, binary_classification_results, model_name=f"{model.version}_valid"
)
performance_metrics.plot_predictions(predictions, model_name=f"{model.version}_valid")
def predict_and_show_results(model, dataset_valid, save_folder="data/processed"):

    y_valid = dataset_valid[model.vardict["target"]].copy()
    dataset_valid = model.preprocessing_inference(dataset_valid)
    predictions = model.predict(dataset=dataset_valid, target_present=False)
    predictions["y_true"] = y_valid.values.tolist()

    show_results(
        predictions,
        model_name=model.version,
        show_plot=model.global_config["show_plot"],
        save_plot=model.global_config["save_plot"],
        save_folder=save_folder,
    )
def show_results(
    predictions,
    model_name,
    show_plot=True,
    save_plot=True,
    save_folder="data/processed",
):

    binary_classification_results = (
        performance_metrics.get_binary_classification_results(
            predictions, model_name, save_folder
        )
    )

    regression_results = performance_metrics.get_regression_results(
        predictions, model_name, save_folder
    )

    performance_metrics.plot_roc_auc_curve(
        predictions, model_name, show_plot, save_plot, save_folder
    )

    performance_metrics.plot_precision_recall_curve(
        predictions,
        binary_classification_results,
        model_name,
        show_plot,
        save_plot,
        save_folder,
    )

    performance_metrics.plot_predictions(
        predictions, model_name, show_plot, save_plot, save_folder
    )<jupyter_output><empty_output><jupyter_text>Hyperparameters search  Import<jupyter_code>import dill
from itertools import product
import numpy as np
import pandas as pd

pd.set_option("display.max_columns", None)

import plotly.graph_objects as go
import matplotlib.pyplot as plt
import seaborn as sns

from sklearn.pipeline import Pipeline
from sklearn.model_selection import GridSearchCV

from imblearn.over_sampling import SMOTE
from sklearn.decomposition import PCA
from sklearn.feature_selection import RFE
from sklearn.preprocessing import StandardScaler

from sklearn.linear_model import LogisticRegression

from src.models.logistic_regression import ModelLogisticRegression
import src.models.performance_metrics as performance_metrics<jupyter_output><empty_output><jupyter_text>Dataset<jupyter_code>overall_hyperparameters_df = pd.DataFrame()
list_sampling = ["None", "SMOTE"]
list_dimension_reduction = ["None", "PCA"]
list_feature_selection = [False, True]
for i_sampling, i_dimension_reduction, i_feature_selection in product(
    list_sampling, list_dimension_reduction, list_feature_selection
):
    print(
        "Sampling: {} - Dimension Reduction: {} - Feature Selection: {}".format(
            i_sampling, i_dimension_reduction, i_feature_selection
        )
    )

    # i_sampling = None  # "SMOTE"
    # i_dimension_reduction = None
    # i_feature_selection = False

    with open(path_dataset_train, "rb") as input_file:
        dataset_train = dill.load(input_file)

    model = ModelLogisticRegression()
    model.version = "hyperparameter_tuning__logistic_regression__20210130"

    ##### 1st part preprocessing - fix

    dataset_train = model.preprocessing_training_numerical(dataset_train)
    dataset_train = model.preprocessing_training_diff_time(dataset_train)
    dataset_train = model.preprocessing_training_boolean(dataset_train)
    dataset_train = model.preprocessing_training_categorical(dataset_train)

    model.vardict["preprocessed"] = (
        model.vardict["numerical"]
        + model.vardict["diff_time"]
        + model.vardict["dummy_boolean"]
        + model.vardict["dummy_categorical"]
    )

    if i_sampling == "SMOTE":
        dataset_train = model.apply_sampling(dataset_train)

    X_train = dataset_train[model.vardict["preprocessed"]]
    y_train = dataset_train[[model.vardict["target"]]]

    ##### additions
    scaler = StandardScaler()
    dimension_reduction = PCA()
    feature_selection = RFE(estimator=LogisticRegression(max_iter=1000))

    ##### model
    model_logistic_regression = LogisticRegression(max_iter=1000)

    ##### pipeline
    pipeline_steps = []
    pipeline_steps.append(("std_slc", scaler))
    if i_dimension_reduction == "PCA":
        pipeline_steps.append(("pca", dimension_reduction))
    if i_feature_selection:
        pipeline_steps.append(("feat_select", feature_selection))
    pipeline_steps.append(("logistic_Reg", model_logistic_regression))

    pipe = Pipeline(
        steps=pipeline_steps,
    )

    ##### grid
    param_grid = {
        "logistic_Reg__penalty": ["l1", "l2"],
        "logistic_Reg__C": np.logspace(
            -4, 10, 2
        ),  #     "logistic_Reg__C": np.logspace(-4, 10, 15),
        "logistic_Reg__solver": ["liblinear", "saga"],
        "logistic_Reg__fit_intercept": [True, False],
    }

    if i_dimension_reduction == "PCA":
        # param_grid["pca__n_components"] = list(range(1, X_train.shape[1] + 1, 1))
        param_grid["pca__n_components"] = list(range(2, 9, 4))
    if i_feature_selection:
        # param_grid["feat_select__n_features_to_select"] = list(
        #    range(1, X_train.shape[1] + 1, 1)
        # )
        param_grid["feat_select__n_features_to_select"] = list(range(1, 9, 4))

    ##### Create grid search object
    clf = GridSearchCV(pipe, param_grid=param_grid, cv=5, verbose=True, n_jobs=6)

    ##### Fit on data
    best_clf = clf.fit(X_train, y_train)

    ##### specify results
    hyperparameters_df = pd.DataFrame.from_dict(clf.cv_results_)

    hyperparameters_df["scaler"] = True

    hyperparameters_df["sampling"] = i_sampling
    hyperparameters_df["dimension_reduction"] = i_dimension_reduction
    hyperparameters_df["feature_selection"] = i_feature_selection

    if not (i_dimension_reduction == "PCA"):
        hyperparameters_df["param_pca__n_components"] = None
    if not (i_feature_selection):
        hyperparameters_df["param_feat_select__n_features_to_select"] = None

    ###### save results
    overall_hyperparameters_df = overall_hyperparameters_df.append(hyperparameters_df)
overall_hyperparameters_df.sort_values("mean_test_score", ascending=False, inplace=True)
overall_hyperparameters_df.to_csv(
    "data/interim/overall_hyperparameters_df.csv", index=False
)
overall_hyperparameters_df<jupyter_output><empty_output><jupyter_text>results<jupyter_code>hyperparameters_df = pd.read_csv("data/interim/overall_hyperparameters_31_step3.csv")
hyperparameters_df
import plotly.graph_objects as go
import pandas as pd


def plot_result_hyperparameter(
    hyperparameters_df,
    hyperparameter_to_plot,
    variable_objective,
    use_log_scale=False,
    minimize_objective=True,
):
    """
    Plot the result of the hyperparameters search.

    hyperparameters_df: DataFrame, results of the hyperparameters search with GridSearchCV, RandomizedSearchCV, optuna ...
    hyperparameter_to_plot: str, must be a column of hyperparameters_df
    variable_objective: str,  must be a column of hyperparameters_df
    use_log_scale: boolean
    minimize_objective: boolean, if true, the lower the objective the better
    """

    hyperparameters_df = hyperparameters_df.copy()
    hyperparameters_df["n_trial"] = range(len(hyperparameters_df))

    if minimize_objective:
        best_hyperparameters = hyperparameters_df.loc[
            hyperparameters_df[variable_objective].idxmin(axis=1)
        ]
    else:
        best_hyperparameters = hyperparameters_df.loc[
            hyperparameters_df[variable_objective].idxmax(axis=1)
        ]

    # Create traces
    fig = go.Figure()

    fig.add_trace(
        go.Scatter(
            x=hyperparameters_df[hyperparameter_to_plot],
            y=hyperparameters_df[variable_objective],
            mode="markers",
            marker=dict(
                color=hyperparameters_df["n_trial"],
                colorscale="Viridis",
                colorbar=dict(title="Number trial"),
                showscale=True,
            ),
            hovertemplate="<b>Trial %{marker.color:.d}</b><br><br>"
            + "Hp: %{x:.5f}<br>"
            + "Obj.: %{y:.5f}<br>"
            + "<extra></extra>",
            showlegend=False,
            name=variable_objective,
        )
    )

    if use_log_scale:
        fig.update_xaxes(type="log")

    fig.add_trace(
        go.Scatter(
            x=[
                best_hyperparameters[hyperparameter_to_plot],
                best_hyperparameters[hyperparameter_to_plot],
            ],
            y=[
                min(hyperparameters_df[variable_objective]),
                max(hyperparameters_df[variable_objective]),
            ],
            mode="lines",
            showlegend=False,
            line=dict(color="#e377c2", dash="dash"),
        )
    )

    fig.update_layout(
        title="Evolution of {} for hyperparameter {}".format(
            variable_objective, hyperparameter_to_plot
        ),
        xaxis_title=hyperparameter_to_plot,
        yaxis_title=variable_objective,
        legend={"itemsizing": "constant"},
    )

    fig.show()
plot_result_hyperparameter(
    hyperparameters_df=hyperparameters_df,
    hyperparameter_to_plot="param_pca__n_components",
    variable_objective="mean_test_score",
    use_log_scale=False,
    minimize_objective=False,
)
plot_result_hyperparameter(
    hyperparameters_df=hyperparameters_df,
    hyperparameter_to_plot="param_feat_select__n_features_to_select",
    variable_objective="mean_test_score",
    use_log_scale=False,
    minimize_objective=False,
)<jupyter_output><empty_output><jupyter_text>categorical variable -> boxplot<jupyter_code>import plotly.graph_objects as go
import pandas as pd


def plot_result_hyperparameter_boxplot(
    hyperparameters_df,
    hyperparameter_to_plot,
    variable_objective,
    use_log_scale=False,
):
    """
    Plot with a boxplot the result of the hyperparameters search.

    hyperparameters_df: DataFrame, results of the hyperparameters search with GridSearchCV, RandomizedSearchCV, optuna ...
    hyperparameter_to_plot: str, must be a column of hyperparameters_df
    variable_objective: str,  must be a column of hyperparameters_df
    use_log_scale: boolean
    """

    hyperparameters_df = hyperparameters_df.copy()

    fig = go.Figure()

    for i_value in set(hyperparameters_df[hyperparameter_to_plot]):

        fig.add_trace(
            go.Box(
                y=hyperparameters_df[
                    hyperparameters_df[hyperparameter_to_plot] == i_value
                ][variable_objective],
                name=str(i_value),
                boxmean="sd",
            )
        )

    if use_log_scale:
        fig.update_xaxes(type="log")

    fig.update_layout(
        title="Evolution of {} for hyperparameter {}".format(
            variable_objective, hyperparameter_to_plot
        ),
        xaxis_title=hyperparameter_to_plot,
        yaxis_title=variable_objective,
        legend={"itemsizing": "constant"},
    )

    fig.show()
plot_result_hyperparameter_boxplot(
    hyperparameters_df=hyperparameters_df,
    hyperparameter_to_plot="param_logistic_Reg__C",
    variable_objective="mean_test_score",
    use_log_scale=True,
)
plot_result_hyperparameter_boxplot(
    hyperparameters_df=hyperparameters_df,
    hyperparameter_to_plot="param_logistic_Reg__C",
    variable_objective="std_test_score",
    use_log_scale=True,
)
plot_result_hyperparameter_boxplot(
    hyperparameters_df=hyperparameters_df,
    hyperparameter_to_plot="param_logistic_Reg__fit_intercept",
    variable_objective="mean_test_score",
    use_log_scale=False,
)
plot_result_hyperparameter_boxplot(
    hyperparameters_df=hyperparameters_df,
    hyperparameter_to_plot="param_logistic_Reg__penalty",
    variable_objective="mean_test_score",
    use_log_scale=False,
)
plot_result_hyperparameter_boxplot(
    hyperparameters_df=hyperparameters_df,
    hyperparameter_to_plot="sampling",
    variable_objective="mean_test_score",
    use_log_scale=False,
)
plot_result_hyperparameter_boxplot(
    hyperparameters_df=hyperparameters_df,
    hyperparameter_to_plot="dimension_reduction",
    variable_objective="mean_test_score",
    use_log_scale=False,
)
plot_result_hyperparameter_boxplot(
    hyperparameters_df=hyperparameters_df,
    hyperparameter_to_plot="feature_selection",
    variable_objective="mean_test_score",
    use_log_scale=False,
)
plot_result_hyperparameter_boxplot(
    hyperparameters_df=hyperparameters_df,
    hyperparameter_to_plot="param_feat_select__n_features_to_select",
    variable_objective="mean_test_score",
    use_log_scale=False,
)<jupyter_output><empty_output><jupyter_text>rest<jupyter_code>print("----- Best parameters -----")
    for i_parameter in list(param_grid.keys()):
        print("{} - {}".format(i_parameter, clf.best_params_[i_parameter]))

        
    hyperparameters_df["rank_test_score_inverse"] = (
        max(hyperparameters_df["rank_test_score"]) - hyperparameters_df["rank_test_score"]
    )
    hyperparameters_df.sort_values("rank_test_score_inverse", inplace=True)
    hyperparameters_df

hyperparameters_df.to_csv("data/interim/hyper_logreg/hyper_3.csv", index=False)
for i_parameter in list(param_grid.keys()):
    # variable_to_plot = "param_pca__n_components"
    variable_to_plot = f"param_{i_parameter}"

    import plotly.graph_objects as go

    # hyperparameters_df.sort_values(variable_to_plot, inplace=True)

    # Create traces
    fig = go.Figure()

    fig.add_trace(
        go.Scatter(
            x=hyperparameters_df[variable_to_plot],
            y=hyperparameters_df["rank_test_score_inverse"],
            mode="markers",
            marker=dict(
                color=hyperparameters_df["mean_test_score"],
                colorscale="Viridis_r",  # one of plotly colorscales
                colorbar=dict(title="mean_test_score"),
                showscale=True,
            ),
            hovertemplate="<b>Trial %{y}</b><br><br>"
            + "Value: %{x:.5f}<br>"
            + "MAE: %{marker.color:.3f}<br>"
            + "<extra></extra>",
            showlegend=False,
            name=variable_to_plot,
        )
    )

    if i_parameter in ["logistic_Reg__C"]:
        fig.update_xaxes(type="log")

    fig.add_trace(
        go.Scatter(
            x=[
                clf.best_params_[i_parameter],
                clf.best_params_[i_parameter],
            ],
            y=[
                min(hyperparameters_df["rank_test_score_inverse"]),
                max(hyperparameters_df["rank_test_score_inverse"]),
            ],
            mode="lines",
            showlegend=False,
            line=dict(color="#e377c2", dash="dash"),
        )
    )

    fig.update_layout(
        title="Evolution of hyperparameter {} by trial".format(variable_to_plot),
        xaxis_title=variable_to_plot,
        yaxis_title="Rank number (the higher, the better ranked)",
        legend={"itemsizing": "constant"},
    )

    fig.update_layout(
        annotations=[
            go.layout.Annotation(
                text="Vertical line: best score",
                align="center",
                showarrow=False,
                xref="paper",
                yref="paper",
                x=0.5,
                y=-0.22,
                bordercolor="black",
                borderwidth=1,
            )
        ]
    )

    fig.show()<jupyter_output><empty_output><jupyter_text>Probas & Predictions<jupyter_code>with open(f"models/{model.version}__model.pkl", "rb") as input_file:
    model = dill.load(input_file)
# get historical data
path_dataset = "data/raw/20201105/dataset_test.pkl"
with open(path_dataset, "rb") as input_file:
    dataset_predictions = dill.load(input_file)

dataset_predictions
y_true = dataset_predictions[model.vardict["target"]].copy()
dataset_predictions = model.preprocessing_inference(dataset_predictions)
predictions = model.predict(dataset=dataset_predictions, target_present=False)
predictions["y_true"] = y_true.values.tolist()
predictions
from src.models.performance_metrics import show_results

show_results(
    predictions,
    model_name="with_pca",
    show_plot=True,
    save_plot=True,
    save_folder="data/raw/20201105",
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10428966599232072, 'fraction_numerical': 0.00503695140580488, 'mean_word_length': 4.277124183006536, 'pattern_counts': {'":': 11, '<': 93, '<?xml version=': 0, '>': 94, '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': '19', 'dir': 'jupyter-structured-clean-dedup', 'id': '627761', 'license': 'MIT', 'n_tokens_mistral': 7993, 'n_tokens_neox': 7704, 'n_words': 1117, 'path': 'notebooks/Modeling - 1.6 - Logistic Regression.ipynb', 'repo_name': 'Blitzy29/vocabulary_learning', 'size': '24221'}