-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevaluate.py
58 lines (44 loc) · 1.63 KB
/
evaluate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""
Module serves to evaluate the quality of data produced by the Synthesizer.
"""
from sdv.evaluation import evaluate
import pandas as pd
class Evaluator():
"""
Class serves to evaluate the quality of data produced by the Synthesizer.
"""
def __init__(self, synthetic_data, verbose = True):
"""
Method to initialize class.
"""
if verbose:
print("Started importing data!")
url_1 = "https://raw.githubusercontent.com/RajeevAtla/Superconductivity-Dataset/master/train.csv"
url_2 = "https://raw.githubusercontent.com/RajeevAtla/Superconductivity-Dataset/master/unique_m.csv"
material_data = pd.read_csv(url_1, header = 0, sep = ",")
material_data.pop("critical_temp")
element_data = pd.read_csv(url_2, header = 0, sep = ",")
element_data.pop("material")
element_data.pop("critical_temp")
data = material_data.join(element_data)
if verbose:
print("Finished importing data!")
self.synthetic_data = synthetic_data
self.real_data = data
self.verbose = verbose
def evaluate_data(self,
aggregate = True,
metrics = None):
"""
Method to evaluate data
"""
if self.verbose:
print("Started evaluating data!")
scores = evaluate(synthetic_data = self.synthetic_data,
real_data = self.real_data,
metrics = metrics,
aggregate = aggregate)
if self.verbose:
print("Finished evaluating data!")
print(scores)
return scores