Skip to content

DLTrainerClassifier ¤

DLTrainerClassifier ¤

DLTrainerClassifier(
    path,
    shared_type=0,
    epoch=5,
    data_scale=0.9,
    vector_size=4,
    batch_size=1,
)

Bases: Classifier

Source code in sema_toolchain/sema_classifier/application/classifier/DL/DLTrainerClassifier.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
def __init__(self, path,
			shared_type=0, epoch=5, data_scale=0.9,
			vector_size=4, batch_size=1):

	super().__init__(path,'DLTrainerClassifier', 0)
	ch = logging.StreamHandler()
	ch.setLevel(logging.INFO)
	ch.setFormatter(CustomFormatter())
	self.log = logging.getLogger("DLTrainerClassifier")
	self.log.setLevel(logging.INFO)
	self.log.addHandler(ch)
	self.log.propagate = False

	self.vector_size = vector_size
	self.data_train = None
	self.data_scale = data_scale

	self.n_features = 0
	self.embedding_dim = 0
	self.classe = 0
	self.n_epochs = epoch
	self.batch_size = batch_size

	self.families = []

	self.y_true = []
	self.y_pred = []
	self.labels = []
	self.TP = 0
	self.TPR = 0
	self.loss = 0

	self.data_load = False
	self._model = None
	self.shared_type = shared_type

	self.apiname = "APInameseq.txt" # TODO more customization
	input_dir_name = os.path.basename(os.path.normpath(path))
	self.fname   = path + '/mapping_' + input_dir_name + '.txt'
	self.apipath = self.apiname #os.path.join(dir_path, apiname)
	self.mappath = self.fname   #os.path.join(dir_path, fname)

detection ¤

detection(path=None)

Malware vs cleanware TODO

Source code in sema_toolchain/sema_classifier/application/classifier/DL/DLTrainerClassifier.py
140
141
142
143
144
145
def detection(self, path=None):
	"""
	Malware vs cleanware
	TODO
	"""
	pass