Commit be613d7c authored by Martin Larralde's avatar Martin Larralde
Browse files

Experiment with training on fragmented input features

parent 03f59d0a
Pipeline #28913 failed with stages
in 1 minute and 50 seconds
......@@ -228,5 +228,16 @@ class ClusterCRF(object):
elif all(y == "0" for y in Y):
raise ValueError("only negative labels found, something is wrong.")
X_fragments = []
Y_fragments = []
N = min( len(x) for x in X ) // 2
for fragment_size in range(5, N):
for (x, y) in zip(X, Y):
fragment_start = random.randint(len(x) - fragment_size)
fragment_features = x[fragment_start:fragment_start+fragment_size]
fragment_labels = y[fragment_start:fragment_start+fragment_size]
# fit the model, Y)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment