Creating Balanced Dataset Using Scikits
If I understood correctly, you want to invent new negative samples to have a balanced dataset, because your current dataset only have positive samples.

However, the library you mentioned only re-samples a dataset where all classes are present. The sample creation process is by definition data-specific, as there can be impossible attribute combinations, etc.

If you want to blindly create combination of attribute values, you can use the stuff in module random:


To create integer attributes:
def random_integer(min_val, max_val):
    return randint.randint(0, 9))

To create real-valued attributes:
def random_float(min_val, max_val):
    return random.uniform(min_val, max_val)

To create discrete attributes:
def random_discrete(value_list):
    return random.choice(value_list)



And then, with a loop, generate your negative samples in a loop:


    def generate_negative_sample():
        return {'attr1': random_discrete(['a', 'b', 'c']),
                'attr2': random_float(-10., 10.),
                'attr3': random_integer(0, 4)}

    random_samples = [generate_negative_sample() for _ in range(1000)]