Skip to content

Instantly share code, notes, and snippets.

View frenzy2106's full-sized avatar

Ankit Choudhary frenzy2106

View GitHub Profile
@frenzy2106
frenzy2106 / Simple_baseline_solution.py
Last active April 6, 2019 08:28
Simple Baseline solution for ML Hikeathon
'''
# Baseline script by Supreet Manyam (Ziron)
'''
import pandas as pd
import numpy as np
import gc
train = pd.read_csv("data/train.csv",
import numpy as np
import pandas as pd
from sklearn.metrics import f1_score
from copy import deepcopy
from collections import namedtuple
# Evaluation metric for Innoplexus NER Challenge
def collect_named_entities(tokens): # Helper Function for score calculation
@frenzy2106
frenzy2106 / map_at_k.py
Last active December 22, 2021 07:17
Mean Average Precision @ K
def apk(actual, predicted, k=3):
"""
Computes the average precision at k.
This function computes the average prescision at k between two lists of
items.
Parameters
----------
actual : list
A list of elements that are to be predicted (order doesn't matter)
predicted : list