Skip to content

Instantly share code, notes, and snippets.

View yousefazizi1982's full-sized avatar

Yousef Azizi yousefazizi1982

View GitHub Profile
@yousefazizi1982
yousefazizi1982 / random_forest.py
Created June 12, 2023 10:29 — forked from tanpengshi/random_forest.py
Random Forest Algorithm from Scratch
"""
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
@yousefazizi1982
yousefazizi1982 / decision_tree.py
Created June 12, 2023 10:29 — forked from tanpengshi/decision_tree.py
Decision Tree Algorithm from Scratch
"""
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
@yousefazizi1982
yousefazizi1982 / chat_clnt.py
Created March 25, 2023 19:16 — forked from schedutron/chat_clnt.py
GUI client script for my chat app
#!/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:
@yousefazizi1982
yousefazizi1982 / 1.srp.py
Created March 24, 2022 00:04 — forked from dmmeteo/1.srp.py
SOLID Principles explained in Python with examples.
"""
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):