This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Implementation of algorithm to train random forest classifiers. | |
Author: Tan Pengshi Alvin | |
Adapted from: https://towardsdatascience.com/master-machine-learning-random-forest-from-scratch-with-python-3efdd51b6d7a | |
""" | |
import numpy as np | |
import pandas as pd | |
from scipy import stats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Implementation of algorithm to train decision tree classifiers. | |
Author: Tan Pengshi Alvin | |
Adapted from: https://towardsdatascience.com/decision-tree-from-scratch-in-python-46e99dfea775 | |
""" | |
import numpy as np | |
import pandas as pd | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Script for Tkinter GUI chat client.""" | |
from socket import AF_INET, socket, SOCK_STREAM | |
from threading import Thread | |
import tkinter | |
def receive(): | |
"""Handles receiving of messages.""" | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Single Responsibility Principle | |
“…You had one job” — Loki to Skurge in Thor: Ragnarok | |
A class should have only one job. | |
If a class has more than one responsibility, it becomes coupled. | |
A change to one responsibility results to modification of the other responsibility. | |
""" | |
class Animal: | |
def __init__(self, name: str): |