Skip to content

Instantly share code, notes, and snippets.

View hugobrilhante's full-sized avatar
🐍
Brilhante

Hugo Brilhante hugobrilhante

🐍
Brilhante
View GitHub Profile
#!/bin/sh
set -e
# Function to display progress
show_progress() {
echo "$1 ... "
}
# Function to display success
@hugobrilhante
hugobrilhante / perceptron.py
Last active December 8, 2018 15:21
Perceptron
def activation(output):
"""
Activation function
:param output: Perceptron algorithm result
:return: 1 if output >= 0 and -1 if output < 0
"""
if output >= 0:
res = 1
else:
@hugobrilhante
hugobrilhante / id3.py
Last active December 8, 2018 15:21
ID3 implementation python
from collections import namedtuple
from dataclasses import dataclass, field
from typing import List
EC = namedtuple('EC', ['rc', 'hc', 'di', 'ga', 're'])
@dataclass(order=True)
class Node:
key: str