コード例 #1
0
 def test_DFS_numpy_sets(self):
     self.runAlgorithm(ps.DFS(ps.NumpySetRepresentation), "DFS numpyset",
                       self.result, self.qualities, self.task)
コード例 #2
0
 def test_DFS_set(self):
     self.runAlgorithm(ps.DFS(ps.SetRepresentation), "DFS set", self.result,
                       self.qualities, self.task)
コード例 #3
0
 def test_DFS_sum(self):
     self.task.qf = ps.CountCallsInterestingMeasure(
         ps.StandardQFNumeric(self.task.qf.a, False, 'sum'))
     self.runAlgorithm(ps.DFS(ps.BitSetRepresentation), "DFS sum",
                       self.result, self.qualities, self.task)
コード例 #4
0
ファイル: toy_example.py プロジェクト: Teculos/pysubgroup
np.random.seed(1111)
target_variables = np.random.randint(low=0, high=2, size=1000)
target_estimates = np.random.uniform(size=1000)
target = ps.PredictionTarget(target_variables, target_estimates, roc_auc_score)

searchSpace_Nominal = ps.create_nominal_selectors(data, ignore=['credit_amount'])
searchSpace_Numeric = [] #ps.create_numeric_selectors(data, ignore=['credit_amount'], nbins=10)
searchSpace = searchSpace_Nominal + searchSpace_Numeric

task = ps.SubgroupDiscoveryTask(data, target, searchSpace, result_set_size=10, depth=5, qf=ps.CountCallsInterestingMeasure(ps.PredictionQFNumeric(1, False)))

resultBS = ps.BeamSearch().execute(task)
resultA = ps.Apriori(use_numba=False).execute(task)
resultA_numba = ps.Apriori(use_numba=True).execute(task)
resultSimpleDFS = ps.SimpleDFS().execute(task)
resultDFS = ps.DFS(ps.BitSetRepresentation).execute(task)
resultDFS.to_dataframe()


############################################################
## Toy example using the default eval to generate answers ##
############################################################


np.random.seed(1111)

eval_dict = {"AUPRC(ish)":average_precision_score}
target_variables = np.random.randint(low=0, high=2, size=1000)
target_estimates = np.random.uniform(size=1000)
target = ps.PredictionTarget(target_variables, target_estimates, eval_dict=eval_dict)
target = ps.PredictionTarget(target_variables, target_estimates)
コード例 #5
0
 def test_DFS(self):
     self.task.qf = ps.CountCallsInterestingMeasure(ps.PredictionQFNumeric(self.task.qf.a, False))
     self.runAlgorithm(ps.DFS(ps.BitSetRepresentation), "DFS", self.DFSresult, self.DFSqualities, self.task)