Skip to content

Instantly share code, notes, and snippets.

@dtrizna
Created September 21, 2022 09:56
Show Gist options
  • Save dtrizna/12cd503f50f7fea209a3c9c89f86bed6 to your computer and use it in GitHub Desktop.
Save dtrizna/12cd503f50f7fea209a3c9c89f86bed6 to your computer and use it in GitHub Desktop.
from sklearn.neural_network import MLPClassifier
X_full_dataset = [...]
y_full_dataset = [...]
mlpModel = MLClassifier(
hidden_layer_sizes=(128,64)
)
mlpModel.fit(full_dataset, y)
false_positives = [
"for i in $(seq 1 10); do nc -znv 127.0.0.1 8080; sleep 80; done",
"curl raw.internalgit.com/prometeus_install.sh | bash"
]
# update model on subset of data
mlpModel.partial_fit(
hvwpt.transform(
false_positives,
np.array([0]*len(false_positives), dtype=int)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment