Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--To include this file, use | |
--dofile('csv.lua') or require('csv') | |
--Function to convert a *SV file to a Lua array | |
--file: the name of the file to read | |
--delim: the delimeter (default ',') | |
function dataToTable(file, delim) | |
--Set initial values | |
if delim == nil then --allow delim to be optional | |
delim = ',' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
import logging, select, subprocess | |
LOG_FILE = "test.log" | |
logger = logging.getLogger(__name__) | |
logging.basicConfig(level=logging.INFO,filename=LOG_FILE,format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') | |
def logging_call(popenargs, **kwargs): | |
process = subprocess.Popen(popenargs, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MultiSampler(Sampler): | |
"""Samples elements more than once in a single pass through the data. | |
This allows the number of samples per epoch to be larger than the number | |
of samples itself, which can be useful for data augmentation. | |
""" | |
def __init__(self, nb_samples, desired_samples, shuffle=False): | |
self.data_samples = nb_samples | |
self.desired_samples = desired_samples | |
self.shuffle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# data from http://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat | |
# Originally seen at http://spatial.ly/2014/08/population-lines/ | |
# So, this blew up on both Reddit and Twitter. Two bugs fixed (southern Spain was a mess, | |
# and some countries where missing -- measure twice, submit once, damnit), and two silly superflous lines removed after | |
# @hadleywickham pointed that out. Also, switched from geom_segment to geom_line. | |
# The result of the code below can be seen at http://imgur.com/ob8c8ph | |
library(tidyverse) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jdbc:teradata://{host::localhost}/[\?<&,user={user},password={password},database={database}>] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile_pdf: | |
image: kmindi/latex-docker | |
script: | |
- latexmk -C -cd -outdir="M2" -auxdir="M2" M2/M2.tex | |
- latexmk -lualatex -pdf -cd -outdir="M2" -auxdir="M2" M2/M2.tex | |
artifacts: | |
paths: | |
- "M2/M2.pdf" | |
expire_in: 1 week | |
except: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Regular expressions I've used to convert a tex file using Biblatex to apacite: | |
(?s)cites{([^{}]*?)}{ | |
cites{\1, | |
(?s)cites{([^{}]*?)}\n{ | |
cites{\1, | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://stackedit.io/libs/MathJax/MathJax.js?config=TeXAMS_HTML></script> | |
> Written with [StackEdit](https://stackedit.io/). | |
# Метрики качества ранжирования | |
Ранжирование --- это задача сортировки набора элементов из соображения их *релевантности*. Чаще всего релевантность понимается по отношению к какому-то объекту. Например, в задаче информационного поиска объект --- это запрос, элементы --- всевозможные документы (ссылки на них), а релевантность --- соответствие документа запросу, в задаче рекомендаций же объект --- это пользователь, элементы --- тот или иной контент (товары, видео, музыка), а релевантность --- вероятность того, что пользователь воспользуется данным контентом. | |
Формально, результат алгоритма ранжирования --- это упорядоченный список элементов фиксированного размера (обозначим его K): $\{i_1, ..., i_K\}$. При проверке результатов алгоритма ранжирования среди предсказанных элементов $\{i_1, ..., i_K\}$ некоторые могут оказаться релевантными (пользовате |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
import warnings | |
import numpy as np | |
import pandas as pd | |
import sys | |
__author__ = "Mohsen Mesgarpour" | |
__copyright__ = "Copyright 2016, https://github.com/mesgarpour" | |
__credits__ = ["Mohsen Mesgarpour"] |