Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace Kaggle.Metrics.Utilities
{
public static class OpenImagesUtil
{
using System;
using System.Linq;
using System.Collections.Generic;
using Kaggle.DataFrames;
using Kaggle.Metrics.Utilities;
using System.Collections.Concurrent;
namespace Kaggle.Metrics.Custom
{
[PublishedEvaluationAlgorithm("OpenImagesObjectDetectionAP", Name = "OpenImagesObjectDetectionAP",
@wendykan
wendykan / base62.py
Created May 20, 2017 19:03
Encoding numbers into Base X
BASE62 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
def encode(num, alphabet=BASE62):
"""Encode a positive number in Base X
Arguments:
- `num`: The number to encode
- `alphabet`: The alphabet to use for encoding
"""
if num == 0:
@wendykan
wendykan / JaccardDSTL.cs
Last active March 17, 2017 05:18
Custom evaluation metric code for DSTL Kaggle competition
using System;
using System.Collections.Generic;
using System.Linq;
using GeoAPI.Geometries;
using Kaggle.DataFrames;
using NetTopologySuite.IO;
namespace Kaggle.Metrics.Custom {
[PublishedEvaluationAlgorithm("JaccardDSTLParallel", Name = "JaccardDSTLParallel",
Description = "JaccardDSTLParallel",
@wendykan
wendykan / rmse_kappa.R
Created January 20, 2016 01:01
plotting RMSE vs Kappa
library(irr)
library(Metrics)
k=0
r=0
for (x in 1:10000) {
pred = as.integer(runif(10, min = 0, max = 4))
truth = as.integer(runif(10, min = 0, max = 4))
@wendykan
wendykan / heart.R
Created March 19, 2015 18:26
plotting a heart in R
dat<- data.frame(t=seq(0, 2*pi, by=0.1) )
xhrt <- function(t) 16*sin(t)^3
yhrt <- function(t) 13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)
dat$y=yhrt(dat$t)
dat$x=xhrt(dat$t)
with(dat, plot(x,y, type="l"))
@wendykan
wendykan / plotPopularity.R
Created January 15, 2015 22:20
Plotting bubble chart on a world map for the number of submissions from each country
library(rworldmap)
data=read.csv("/Users/wendy/Downloads/QueryResults (5).csv")
sPDF <- joinCountryData2Map( data ,joinCode = "ISO2" ,nameJoinColumn = "Country")
mapBubbles(sPDF,nameZSize="numSubmissions",oceanCol="lightblue",landCol="wheat")