I hereby claim:
- I am syncrossus on github.
- I am syncrossus (https://keybase.io/syncrossus) on keybase.
- I have a public key ASDJ1fvJbb42jvF3Gn51iZ6dvz4d2IwfAfbQWb870hixSQo
To claim this, I am signing this object:
class Apprenant: | |
""" | |
Classe modelisant un apprenant bayesien | |
Attributs : | |
classes : classes identifiees dans la base d'apprentissage | |
valAttr : valeurs que peut prendre l'attribut des objets classables | |
tableau : Chaque ligne est une classe, chaque colonne une valeur d'attribut. | |
Chaque cellule contient l'effectif de la base d'apprentissage correspondant. | |
ex : | |
|1.6|1.7|1.8|1.9 |
% solution to the problem WWWDOT - GOOGLE = DOTCOM in prolog | |
carry(0). | |
carry(1). | |
digit(A) :- carry(A). | |
digit(2). | |
digit(3). | |
digit(4). | |
digit(5). | |
digit(6). |
I hereby claim:
To claim this, I am signing this object:
# arguments : | |
# labels1 : list of labels corresponding to the wrong clusters | |
# labels2 : list of labels corresponding to the right clusters | |
# return : | |
# labels1 relabeled | |
relabel <- function(labels1, labels2){ | |
newlabels <- labels1 | |
levels1 <- levels(as.factor(labels1)) | |
levels2 <- levels(as.factor(labels2)) | |
for(i in levels1){ |
# Fisher's criterion computation function | |
# arguments : | |
# clusters : list as returned by clustfisher (see below) | |
# return : | |
# the value of the criterion | |
fisherCriterion <- function(clusters){ | |
diameterSum <- 0 | |
if(length(clusters$instants)==1){ | |
diameterSum <- sum(clusters$D[clusters$instants[1:length(clusters$instants)-1], clusters$instants[2:length(clusters$instants)]-1]) | |
} |
import numpy as np | |
def levenshtein(l1, l2): | |
""" Computes Levenshtein distance between two list-like objects | |
Args: | |
l1, l2: subscriptable objects compatible with len() | |
containing objects comparable with the `!=` operator. | |
""" | |
# initializing the distance matrix |
import numpy as np | |
def score2rank(m): | |
""" args: | |
- m, a numpy matrix with 2 columns the 2nd of which should be numeric | |
returns: | |
- m with the second column's numbers switched for ranks | |
example: | |
m = [[a,5.8], return = [[a,2], |
""" This module contains a simple identicon creation utility function. | |
Original color palette : coolors.co/659bd8-ff776d-ffd793-9eefae-c99dba | |
""" | |
import hashlib | |
import random | |
import png # requires pypng (version 0.0.19 recommended) | |
import sys | |
palette = {0: (255, 255, 255), | |
1: (101, 155, 216), |
def dichotomy(ls, v, _i=0): | |
""" Dichotomy search, or the optimal search for an item's index | |
in a sorted list. | |
Arguments: | |
- (list) ls: the list in which to search, must be sorted for | |
this to work | |
- v: value to search for in the list, must be comparable to the | |
items in the list | |
- (int) _i: should not be used, is reserved for recursive purposes | |
Returns: |
# Garbage matcher | |
# matches any string consisting of only |, <, >, +, *, ^, #, =, and hyphen chains. | |
# this is to identify patterns like ++<===> ######## <---->^^ which serve no purpose but to decorate the text | |
/(\||(--+)|(__+)|<|>|\+|\*|\^|#|=|~)+|(\\|_|\/){2,}/ | |
# Garbage matcher 2 | |
# matches anything that isn't a letter, space or basic punctuation. | |
# this is typically useful for cleaning up emojis | |
/.(?<!([a-zA-Z0-9]|,|\.|'| |\?|\!))/ |