Verifiable, automated scoring of social interactions in animal groupsΒΆ

vassi logo.

vassi can help you to

You can use vassi to implement a full behavioral scoring pipeline in Python, train a machine-learning model, and use it to predict behavioral sequences.

# load training dataset
dataset_train = load_dataset("train", ...)

# configure feature extractor
extractor = FeatureExtractor().read_yaml("feature_config.yaml")

# extract samples from dataset
X, y = dataset_train.subsample(extractor, size=0.1)

# train classifier
from sklearn.ensemble import RandomForestClassifier
classifier = RandomForestClassifier()
classifier.fit(X, dataset_train.encode(y))

# load test dataset and predict
dataset_test = load_dataset("test",  ...)
classification_result = predict(dataset_test, classifier, extractor)

# postprocessing
processed_result = classification_result.smooth(
    lambda array: sliding_mean(array, window_size=5)
).threshold(
    [0.1, 0.8]  # assuming two categories
)

# save for downstream behavioral analyses
processed_result.predictions.to_csv("predictions.csv")

Refer to the basic usage page if you want to test vassi on an existing dataset.

The following video gives an overview of the interactive validation tool that complements the classification pipeline.

You can also have a look at the interactive validation notebook that we used to record this video.