Ejemplo n.º 1
0
    def handle_debug_button(self, index):
        y = 10
        print 'Debug button clicked : ' + str(index)
        d = mg.load_dataset('table_B')
        model = DataModel(d)
        view = MTableView(model)

        view.show()
Ejemplo n.º 2
0
import magellan as mg
import numpy as np

A = mg.load_dataset('table_A')
B = mg.load_dataset('table_B')

ob = mg.OverlapBlocker()

C = ob.block_tables(A,
                    B,
                    'address',
                    'address',
                    word_level=False,
                    qgram=3,
                    overlap_size=3,
                    l_output_attrs=['name', 'name'])
D = ob.block_candset(C, 'name', 'name', overlap_size=1)

E = ob.block_tuples(A.ix[1], B.ix[1], 'name', 'name', overlap_size=1)

print C
print "-----"
print D

print " ----- "

print E
Ejemplo n.º 3
0
import magellan as mg
A = mg.load_dataset('table_A', 'id')
B = mg.load_dataset('table_B', 'id')

Ap, Bp = mg.down_sample(A, B, 5, 2)

print Ap

print Bp
Ejemplo n.º 4
0
import sys
import magellan as mg
from magellan.gui.debug_gui_base import vis_debug_dt

sys.path.append('/Users/Pradap/Documents/Research/Python-Package/enrique/')
mg.init_jvm()

A = mg.load_dataset('table_A')
B = mg.load_dataset('table_B')
ab = mg.AttrEquivalenceBlocker()
C = ab.block_tables(A, B, 'zipcode', 'zipcode', ['name'], ['name'])
L = mg.read_csv('label_demo.csv', ltable=A, rtable=B)
feat_table = mg.get_features_for_matching(A, B)
G = mg.extract_feature_vecs(L, feature_table=feat_table, attrs_after='gold')
S = mg.train_test_split(G, 8, 7)
dt = mg.DTMatcher(name='DecisionTree')
dt.fit(table = S['train'], exclude_attrs=['_id', 'ltable.ID', 'rtable.ID', 'gold'], target_attr='gold')
dt.predict(table=S['test'], exclude_attrs=['_id', 'ltable.ID', 'rtable.ID', 'gold'], target_attr='predicted',
           append=True)
d = mg.eval_matches(S['test'], 'gold', 'predicted')

vis_debug_dt(dt, d, S['test'], exclude_attrs=['_id', 'ltable.ID', 'rtable.ID', 'gold'], feat_table=feat_table)
print "Hi"
Ejemplo n.º 5
0
 def change_table_contents(self):
     d = mg.load_dataset('table_B')
     self.model = DataModel(d)
     self.view.set_model(self.model)
     self.view.paint_gui()
Ejemplo n.º 6
0
        self.setLayout(layout)
        # QApplication.setStyle(QStyleFactory.create('motif'))

    def change_table_contents(self):
        d = mg.load_dataset('table_B')
        self.model = DataModel(d)
        self.view.set_model(self.model)
        self.view.paint_gui()
        # model = DataModel(d)
        # view = MTableView(model)

        # view.show()






import magellan as mg
import sys
app = mg._viewapp
d = mg.load_dataset('table_A')
# w = MWidget(d)
w = MurWidget(d)
w.show()

(app.exec_())



Ejemplo n.º 7
0
import magellan as mg

A = mg.load_dataset('table_A', key='ID')
A1= A[['ID']]
d = mg.get_attr_types(A1)
print(d)
Ejemplo n.º 8
0
        self.debug_widget = TreeViewWithLabel(self, "Tree details", type="dt")

        layout = QtGui.QHBoxLayout()
        splitter1 = QtGui.QSplitter(QtCore.Qt.Vertical)
        splitter1.addWidget(self.left_tuple_widget)
        splitter1.addWidget(self.right_tuple_widget)

        splitter2 = QtGui.QSplitter(QtCore.Qt.Horizontal)
        splitter2.addWidget(splitter1)
        splitter2.addWidget(self.debug_widget)
        layout.addWidget(splitter2)
        self.setLayout(layout)


import magellan as mg
from collections import OrderedDict
app = mg._viewapp
dataframe = mg.load_dataset('table_A')
b = mg.load_dataset('table_B')
metric_data = OrderedDict()
metric_data['Precision'] = 0.95
metric_data['Recall'] = 0.93
metric_data['F1'] = 0.94
metric_data['Num. False Positives'] = 5
metric_data['Num. False Negatives'] = 6

m = MainWindowManager(metric_data, dataframe, b)
m.show()
app.exec_()

Ejemplo n.º 9
0
# coding=utf-8
import magellan as mg

A = mg.load_dataset('table_A', key='ID')
B = mg.load_dataset('table_B', key='ID')
F = mg.get_features_for_blocking(A, B)
print(F)

Ejemplo n.º 10
0
        # self.debug_widget = DictTableViewWithLabel(self, self.debug_result, 'Debug Result')
        self.debug_widget = TreeViewWithLabel(self, "Tree details", type="dt")

        layout = QtGui.QHBoxLayout()
        splitter1 = QtGui.QSplitter(QtCore.Qt.Vertical)
        splitter1.addWidget(self.left_tuple_widget)
        splitter1.addWidget(self.right_tuple_widget)

        splitter2 = QtGui.QSplitter(QtCore.Qt.Horizontal)
        splitter2.addWidget(splitter1)
        splitter2.addWidget(self.debug_widget)
        layout.addWidget(splitter2)
        self.setLayout(layout)


import magellan as mg
from collections import OrderedDict
app = mg._viewapp
dataframe = mg.load_dataset('table_A')
b = mg.load_dataset('table_B')
metric_data = OrderedDict()
metric_data['Precision'] = 0.95
metric_data['Recall'] = 0.93
metric_data['F1'] = 0.94
metric_data['Num. False Positives'] = 5
metric_data['Num. False Negatives'] = 6

m = MainWindowManager(metric_data, dataframe, b)
m.show()
app.exec_()