Skip to content

Instantly share code, notes, and snippets.

View huang-xx's full-sized avatar

hyf huang-xx

  • ByteDance
  • Beijing
View GitHub Profile
@huang-xx
huang-xx / python.js
Created December 13, 2023 14:25 — forked from valdergallo/python.js
Snippet for VSCode Python
{
// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@huang-xx
huang-xx / ranking.py
Created February 10, 2023 03:10 — forked from tgsmith61591/ranking.py
Ranking metrics for recommender systems
# -*- coding: utf-8 -*-
#
# Author: Taylor G Smith
#
# Recommender system ranking metrics derived from Spark source for use with
# Python-based recommender libraries (i.e., implicit,
# http://github.com/benfred/implicit/). These metrics are derived from the
# original Spark Scala source code for recommender metrics.
# https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala
@huang-xx
huang-xx / letor_metrics.py
Created February 2, 2023 07:37 — forked from mblondel/letor_metrics.py
Learning to rank metrics.
# (C) Mathieu Blondel, November 2013
# License: BSD 3 clause
import numpy as np
def ranking_precision_score(y_true, y_score, k=10):
"""Precision at rank k
Parameters
@huang-xx
huang-xx / git_local_installation.sh
Created November 5, 2021 13:06 — forked from abelardojarab/git_local_installation.sh
bash script for installing git without root access
#!/bin/bash
wget https://curl.haxx.se/download/curl-7.47.1.tar.gz
tar -xf curl-7.47.1.tar.gz
cd curl-7.47.1
./configure --prefix=$HOME/local
make
make install
wget http://downloads.sourceforge.net/expat/expat-2.1.0.tar.gz
@huang-xx
huang-xx / tmux_local_install.sh
Created November 4, 2021 13:45 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8