Skip to content

Instantly share code, notes, and snippets.

@jmsalcido
jmsalcido / load_poetry_docker_compose_into_pycharm.md
Last active January 9, 2025 14:28
Load correctly poetry environment from docker compose into pycharm available environments

PyCharm and Poetry with Docker (Compose)

I use PyCharm for my python development and normally I use a virtual env but now I found poetry and it manages the dependencies in a better way than just having a pip requirements file.

I had issues loading correctly a poetry environment from docker compose into pycharm available environments.

This sometimes works, sometimes I just reload the entire environment.

Step 1:

Run your docker image of course.

@lmassaron
lmassaron / target_encode
Last active September 13, 2024 05:16
Preprocessing scheme for high-cardinality categorical attributes
def add_noise(series, noise_level):
return series * (1 + noise_level * np.random.randn(len(series)))
def target_encode(trn_series=None, tst_series=None, target=None, k=1, f=1, noise_level=0):
"""
Encoding is computed like in the following paper by:
Micci-Barreca, Daniele. "A preprocessing scheme for high-cardinality categorical attributes in classification and prediction problems." ACM SIGKDD Explorations Newsletter 3.1 (2001): 27-32.
trn_series (pd.Series) : categorical feature in-sample
# -*- coding: utf8 -*-
"""Convex factorization machines
Implements the solver by: Mathieu Blondel, Akinori Fujino, Naonori Ueda.
"Convex factorization machines". Proc. of ECML-PKDD 2015
http://www.mblondel.org/publications/mblondel-ecmlpkdd2015.pdf
"""
# Author: Vlad Niculae <vlad@vene.ro>
# License: Simplified BSD
""" Poisson-loss Factorization Machines with Numba
Follows the vanilla FM model from:
Steffen Rendle (2012): Factorization Machines with libFM.
In: ACM Trans. Intell. Syst. Technol., 3(3), May.
http://doi.acm.org/10.1145/2168752.2168771
See also: https://github.com/coreylynch/pyFM
"""
@houmei
houmei / HID-Report-Desciripter.txt
Created October 8, 2012 18:31
USB JP-Keyboard / Arduino Leonardo HID Report Descriptor
japanese USB Keyboard:
Interface 0 HID Report Descriptor Keyboard
Usage Page (Generig Desktop) 0501
Usage (Keyboard) 0906
Collection (Application) A101
Usage Page (Keyboard/Keypad) 0507
Usage Minimum (Keyboard Left Control) 19E0
Usage Maximum (Keyboard Right GUI) 29E7
Logical Minimum (0) 1500