Ejemplo n.º 1
0
def generate_heuristics_miner_net(xes_log):
    try:
        heu_net = heuristics_miner.apply_heu(xes_log)
        gviz = hn_vis_factory.apply(heu_net)
        hn_vis_factory.view(gviz)
        return {'heu_net': heu_net}
    except AttributeError:
        print("Please check your input values")
Ejemplo n.º 2
0
def execute_script():
    log = xes_importer.apply(
        os.path.join("..", "tests", "compressed_input_data",
                     "09_a32f0n00.xes.gz"))
    heu_net = heuristics_miner.apply_heu(
        log, parameters={"dependency_thresh": 0.99})
    gviz = hn_vis_factory.apply(heu_net, parameters={"format": "svg"})
    hn_vis_factory.view(gviz)
    net, im, fm = heuristics_miner.apply(
        log, parameters={"dependency_thresh": 0.99})
    gviz2 = petri_vis_factory.apply(net, im, fm, parameters={"format": "svg"})
    petri_vis_factory.view(gviz2)
    a2 = pcaDataWeeksFrequency[w].loc[
        pcaDataWeeksFrequency[w]['result_exam_1'] == 1, ['pc2']]
    b2 = pcaDataWeeksFrequency[w].loc[
        pcaDataWeeksFrequency[w]['result_exam_1'] == 0, ['pc2']]
    t2, p2 = stats.ttest_ind(a2, b2)

    print('Week ' + str(w) + ':')
    print('--PC1: ' + 't-value: ' + str(t1) + ' p-value: ' + str(p1))
    print('-- Excellent: ' + str(a1.mean()[0]))
    print('-- Weak: ' + str(b1.mean()[0]))
    print('--PC2: ' + 't-value: ' + str(t2) + ' p-value: ' + str(p2))
    print('-- Excellent: ' + str(a2.mean()[0]))
    print('-- Weak: ' + str(b2.mean()[0]))

#Heuristic Miner
from pm4py.objects.conversion.log import factory as conversion_factory
Log = pd.concat(workingWeekLog)

ex1_personal_log_1_converted = conversion_factory.apply(
    Log.loc[Log['org:resource'].isin(ex3_excellent.index)])
ex1_personal_log_2_converted = conversion_factory.apply(
    Log.loc[Log['org:resource'].isin(ex3_weak.index)])

from pm4py.algo.discovery.heuristics import factory as heuristics_miner
from pm4py.visualization.heuristics_net import factory as hn_vis_factory

excellent_heu_net = heuristics_miner.apply_heu(
    ex1_personal_log_2_converted, parameters={"dependency_thresh": 0.0})
gviz = hn_vis_factory.apply(excellent_heu_net)
hn_vis_factory.view(gviz)