Skip to content

Instantly share code, notes, and snippets.

@GokulEpiphany
GokulEpiphany / snakes_local_validation_set_scores_generation.py
Created June 2, 2020 17:35
Calculating Precision, Recall and F1 scores for the validation set (TD1)
import pandas as pd
import numpy as np
df = pd.read_csv('data_table_exact_count.csv')
df_needed = df.iloc[:,1:]
df_class = df.iloc[:,0]
total_count_per_species= df_needed.sum(axis=1) # row wise
total_predicted_per_species = df_needed.sum(axis=1) # column wise
cumulative_f1 = []
total_correct = []
!/usr/bin/env python
# -*- coding: utf-8 -*-
# Import required libraries, including python-requests and hcsr04.py
import sys, time, requests, json, hcsr04
import RPi.GPIO as GPIO
# Set a default interval of 5 seconds. If the script was run with an argument,
# such as "python ultrasonic_harvest.py 2", use that value instead.
interval=3 if len(sys.argv)==1 else int(sys.argv[1])