Skip to content

Instantly share code, notes, and snippets.

💭
Working at Çay Bahçesi :)

Ismail SEZEN isezen

View GitHub Profile
View split_integer_n_equal_value.py
def _split_n(x, n):
y = [x // n for i in range(n)]
for i in range(x % n):
y[i] += 1
return y
@isezen
isezen / bact2.py
Created Nov 4, 2017
1-D Bacterium Example
View bact2.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=C0103, C0321, C0330
"""1-D Bacterium class example"""
from random import randint as rnd
import gc
import time
from matplotlib import pyplot as plt
from datetime import datetime as dt
@isezen
isezen / kNN_example.r
Last active May 13, 2017
kNN Example
View kNN_example.r
library(class)
library(gmodels)
set.seed(6)
df <- data.frame(A = c(rnorm(30, 0), rnorm(30, 3)),
B = c(rnorm(30, 0), rnorm(30, 3)),
Group = factor(c(rep("G1", 30), rep("G2", 30))))
# use 33% of data for training and 67% is for test
i <- sample(2, nrow(df), replace = TRUE, prob = c(0.67, 0.33))
train.df <- df[i == 2, -3] # do not include last column
train.cl <- df[i == 2, 3] # training result cluters
View hw1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@isezen
isezen / file.py
Created Apr 22, 2016
get path from __file__ or os.getcwd()
View file.py
import os
if '__file__' in globals():
cdir = os.path.dirname(os.path.realpath(__file__))
else:
cdir = os.getcwd()
You can’t perform that action at this time.