Skip to content
Snippets Groups Projects
Commit c188067d authored by Noordijk, Ben's avatar Noordijk, Ben
Browse files

Updated docstring and decreased step size

parent 959894f8
No related branches found
No related tags found
1 merge request!5compare_accuracy.py now saves confusion matrices and can be called on the...
......@@ -127,16 +127,16 @@ class NeuralNetwork(object):
def predict(self, x, clean_signal=True, return_probs=False):
"""Given sequences input as x, predict if they contain target k-mer.
Assumes that read is already split up into smaller batches.
Assumes the sequence x is a read that has been normalised,
but not cut into smaller chunks
:param x: Squiggle as numeric representation
:type x: np.ndarray
:param clean_signal:
:param return_probs:
:return: unnormalized predicted values
:rtype: np.array of posteriors
"""
offset = self.filter_width // 4
offset = self.filter_width // 5
ho = offset // 2
lb, rb = self.hfw - ho, self.hfw + ho + 1
idx = np.arange(self.filter_width, len(x) + offset, offset)
......@@ -147,7 +147,6 @@ class NeuralNetwork(object):
truncating='post',
dtype='float32'), -1)
# Put predicted class = 1 where posterior is larger than threshold
posteriors = self.model.predict(x_pad)
y_hat = posteriors > self.threshold
y_out = np.zeros(len(x), dtype=int)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment