<commit_before>import numpy as np


# This class generates a 2D dataset with two classes, "positive" and "negative".
# Each class follows a Gaussian distribution.
class SimpleDataSet:
    """ A simple two dimensional dataset for visualization purposes. The date set contains points from two gaussians with mean u_i and std_i"""

    def __init__(self, nr_examples=100, g1=[[-5, -5], 1], g2=[[5, 5], 1], balance=0.5, split=[0.8, 0, 0.2]):
        # FIXME: cast to int
        nr_positive = nr_examples * balance  # number of examples of "positive" class
        nr_negative = nr_examples - nr_positive  # number of examples of "negative" class
        self.mean1 = g1[0]  # mean of positive class
        self.mean2 = g2[0]  # mean of negative class
        self.variance1 = g1[1]  #
        self.variance2 = g2[1]
        self.balance = balance
        self.nr_points = nr_examples
        X_pos_1 = np.random.normal(g1[0][0], g1[1], [nr_positive, 1])
        X_pos_2 = np.random.normal(g1[0][1], g1[1], [nr_positive, 1])
        X_pos = np.hstack([X_pos_1, X_pos_2])
        X_neg_1 = np.random.normal(g2[0][0], g2[1], [nr_negative, 1])
        X_neg_2 = np.random.normal(g2[0][1], g2[1], [nr_negative, 1])
        X_neg = np.hstack([X_neg_1, X_neg_2])
        y_pos = np.zeros([nr_positive, 1], dtype=np.int)
        y_neg = np.ones([nr_negative, 1], dtype=np.int)
        X = np.vstack([X_pos, X_neg])
        y = np.vstack([y_pos, y_neg])
<commit_msg>fix bug float/int conversion<commit_after>import numpy as np


# This class generates a 2D dataset with two classes, "positive" and "negative".
# Each class follows a Gaussian distribution.
class SimpleDataSet:
    """ A simple two dimensional dataset for visualization purposes. The date set contains points from two gaussians with mean u_i and std_i"""

    def __init__(self, nr_examples=100, g1=[[-5, -5], 1], g2=[[5, 5], 1], balance=0.5, split=[0.8, 0, 0.2]):
        nr_positive = int(nr_examples * balance)  # number of examples of "positive" class
        nr_negative = int(nr_examples - nr_positive)  # number of examples of "negative" class
        self.mean1 = g1[0]  # mean of positive class
        self.mean2 = g2[0]  # mean of negative class
        self.variance1 = g1[1]  #
        self.variance2 = g2[1]
        self.balance = balance
        self.nr_points = nr_examples
        X_pos_1 = np.random.normal(g1[0][0], g1[1], [nr_positive, 1])
        X_pos_2 = np.random.normal(g1[0][1], g1[1], [nr_positive, 1])
        X_pos = np.hstack([X_pos_1, X_pos_2])
        X_neg_1 = np.random.normal(g2[0][0], g2[1], [nr_negative, 1])
        X_neg_2 = np.random.normal(g2[0][1], g2[1], [nr_negative, 1])
        X_neg = np.hstack([X_neg_1, X_neg_2])
        y_pos = np.zeros([nr_positive, 1], dtype=np.int)
        y_neg = np.ones([nr_negative, 1], dtype=np.int)
        X = np.vstack([X_pos, X_neg])
        y = np.vstack([y_pos, y_neg])

{'fraction_non_alphanumeric': 0.13936682725395733, 'fraction_numerical': 0.044735030970406056, 'mean_word_length': 2.993131868131868, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '3200617', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1056, 'n_words': 279}