<commit_before>from kreveik import *
import logging
import numpy as num
logging.basicConfig(level=logging.INFO)

petri = classes.Family()
motiflist = []
scores = []
degrees = []
allmotifs = network.all_conn_motifs(3)

for i in xrange(200):
    a = network.generators.random(7, network.boolfuncs.xor_masking_C,
                                     network.scorers.orbit_length_sum_f,
                                     probability=(0.2,0.5,0.5),
                                     connected=True)
    petri.add(a)
    

petri.scorer = network.scorers.sum_scorer_f
petri.selector = network.selectors.hard_threshold_with_probability
petri.mutator = network.mutators.degree_preserving_mutation
petri.killer = family.killer.random_killer


for i in xrange(100):
    print "("+str(i)+"/100)"
    kwargs = {'motiflist':allmotifs[:],'prob':0.2,'threshold':0.01}
    genetic.genetic_iteration(petri,**kwargs)
    motiflist.append(family.motif_freqs(petri, 3, **kwargs))
    scores.append(num.mean([network.score for network in petri]))
    degrees.append(num.mean([element.outdegree() for element in petri]))
    print [element.outdegree() for element in petri]
    
<commit_msg>changed the example. 	<commit_after>from kreveik import *
import logging
import numpy as num
logging.basicConfig(level=logging.INFO)

petri = classes.Family()
motiflist = []
scores = []
degrees = []
allmotifs = network.all_conn_motifs(3)

for i in xrange(200):
    a = network.generators.random(7, network.boolfuncs.xor_masking_C,
                                     network.scorers.sum_scorer_f,
                                     probability=(0.2,0.5,0.5),
                                     connected=True)
    petri.add(a)
    

petri.scorer = network.scorers.sum_scorer_f
petri.selector = network.selectors.hard_threshold_with_probability
petri.mutator = network.mutators.degree_preserving_mutation
petri.killer = family.killer.random_killer


for i in xrange(100):
    print "("+str(i)+"/100)"
    kwargs = {'motiflist':allmotifs[:],'prob':0.2,'threshold':0.01}
    genetic.genetic_iteration(petri,**kwargs)
    motiflist.append(family.motif_freqs(petri, 3, **kwargs))
    scores.append(num.mean([network.score for network in petri]))
    degrees.append(num.mean([element.outdegree() for element in petri]))
    print [element.outdegree() for element in petri]
    

{'fraction_non_alphanumeric': 0.12292641429179073, 'fraction_numerical': 0.019566142067205444, 'mean_word_length': 3.1554770318021204, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3156829', 'n_tokens_mistral': 808, 'n_tokens_neox': 772, 'n_words': 131}