I hereby claim:
- I am estebanz01 on github.
- I am estebanz01 (https://keybase.io/estebanz01) on keybase.
- I have a public key ASBd7idQRbpevu7U2Qy50R8IEZPCf9scloEWWPAoy-bLFwo
To claim this, I am signing this object:
defmodule Distances do | |
def euclidean(a, b) when length(a) > 0 and length(b) > 0 and length(a) == length(b) do | |
# We zip both lists into one, then we reduce it to the euclidean calculation. | |
# Enum.zip_reduce(a, b, 0, fn) <- as a shortcut. | |
Stream.zip(a, b) | |
|> Enum.reduce(0, fn {x, y}, accumulator -> | |
accumulator + (x - y) ** 2 | |
end) | |
|> :math.sqrt() | |
end |
source 'https://rubygems.org' | |
gem 'faker' |
/* | |
* CSS chat | |
*/ | |
body { | |
top: 0; | |
left: 0; | |
background-color: #caccd1; | |
margin-left: 35%; | |
margin-right: 35%; |
RADICADO,FECHA,HORA,DÍA DE LA SEMANA,CLASE DE VEHICULO,TIPO DE SERVICIO,TIPO DE VICTIMA,SEXO,ESTADO DE BEODEZ,RESULTADO DE BEODEZ,GRAVEDAD,CLASE DE ACCIDENTE,CAUSA,DIRECCIÓN,BARRIO,AREA,Coordenadas | |
2181714,06/30/2018,2:55 p.m.,sábado,TRACTOCAMION,PUBLICO,Conductor,Masculino,No,N/A,SOLO DAÑOS,Choque,No mantener distancia de seguridad,Carrera 48 Calle 50 Sur,LAS VEGAS,Urbana, | |
2181733,06/30/2018,9:50 a.m.,sábado,BUS,PUBLICO,Conductor,Masculino,No,N/A,SOLO DAÑOS,Choque,Desobedecer senales,Carrera 50 Calle 46 Sur,LAS VEGAS,Urbana,"(6.16131219, -75.603198185)" | |
2181733,06/30/2018,9:50 a.m.,sábado,AUTOMOVIL,PARTICULAR,Conductor,Masculino,No,N/A,SOLO DAÑOS,Choque,Desobedecer senales,Carrera 50 Calle 46 Sur,LAS VEGAS,Urbana,"(6.16131219, -75.603198185)" | |
2181717,06/30/2018,10:45 p.m.,sábado,MOTOCICLETA,PARTICULAR,Motociclista,Masculino,No,N/A,SOLO DAÑOS,Choque,Desobedecer senales,Calle 37 Sur Carrera 36,MESA,Urbana,"(6.168044613, -75.583236971)" | |
2181717,06/30/2018,10:45 p.m.,sábado,AUTOMOVIL,PARTICULAR,Conductor,Mas |
def x_sub(index, lower, h) | |
x_k = lower + (index * h) | |
end | |
def booles_rule(lower, upper, &block) | |
h = (upper - lower) / 4.0 | |
sum = 0 | |
sum += 7 * yield(lower) | |
sum += 32 * yield(x_sub(1, lower, h)) |
#!/usr/env ruby | |
def derivative_of(f:, x:) | |
h = 1e-14 # 1 * 10^-14 this is the smallest number ruby can handle in calculations before defaulting result to zero. | |
(f.call(x + h) - f.call(x)) / h # This is a naive approach to calculate limit of f(x) in x. | |
end | |
# Newton's Method, where we calculate f(x), f'(x) and calculate error. | |
def find_root(f:, seed:, iterations: nil, error_level: nil) |
# I got this working with code from https://datascienceplus.com/random-forests-in-r/ | |
# It is an excelent resource! | |
set.seed(50) | |
bikeperday <- read.csv('Bike-Sharing-Dataset/day.csv') | |
# Calculate sample | |
sample <- sample.int(n = nrow(bikeperday), | |
size = floor(.75 * nrow(bikeperday)), | |
replace = F) |
I hereby claim:
To claim this, I am signing this object:
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account. | |
Token for proof: | |
[Verifying my OpenPGP key: openpgp4fpr:d97d4f52f25a2a8d5e8874a061dea3a7bf851a0f] |
#include <iostream> | |
#include <string> | |
#include <iomanip> | |
using namespace std; | |
class Leave { | |
public: | |
int idNumber; | |
string name; |