Skip to content

Instantly share code, notes, and snippets.

View Om4AI's full-sized avatar
:electron:
We are user agents in a multi-agent self play game

Om Mule Om4AI

:electron:
We are user agents in a multi-agent self play game
View GitHub Profile
@Om4AI
Om4AI / Get_next_root.py
Created February 22, 2022 18:52
Next root in current dataframe
# Function to get the next root node
def get_next_root(df, out_col, positive_attr):
l = list(df.columns)
l.remove(out_col)
# Get the root node
root = ""
max_infogain = 0
for attr in l:
t = cal_information_gain(df, attr, out_col, positive_attr)
@Om4AI
Om4AI / Helper_Functions.py
Created February 22, 2022 18:46
ID3 Algo helper functions
# Import libraries
import numpy as np
import pandas as pd
import math
from pprint import pprint
# Function to get Data
# Import dataset and create df
def get_data(file, index_col):
df = pd.read_csv(file, index_col=index_col)
@Om4AI
Om4AI / Page replacement Algorithms.cpp
Created October 21, 2020 04:06
This code contains all the Page replacement Algorithms including: FIFO,LIFO,LRU,LFU and OPTIMAL
# include <iostream>
using namespace std;
int page_fault(int el,int pf[],int npf){
int j;
int f=0;
for (j=0;j<npf;j++){
if (pf[j]==el){
f=1;
break;