Instantly share code, notes, and snippets.

ikigai

ikigai
• Sort options
Last active Mar 19, 2019
Naive Bayes From Scratch in Python
View NaiveBayes.py
 #How To Implement Naive Bayes From Scratch in Python #http://machinelearningmastery.com/naive-bayes-classifier-scratch-python/ #Dataset #https://archive.ics.uci.edu/ml/machine-learning-databases/pima-indians-diabetes/pima-indians-diabetes.data import csv import math import random #Handle data
Created Sep 21, 2016
This Gist gives a code snippet for histogram equalization in OpenCV. In line 63, you should enter your source image name
View Histogram Equalization OpenCV C++
 #include #include #include using namespace std; using namespace cv; //function to take histogram of input image void imageHistogram(Mat image, int histogram[]) { // initialize all intensity values to 0
Created May 6, 2017
Bilateral Filter - MATLAB
View bilateral_filter.m
 clc, close all, clear all; img = imread('puppy.jpg'); A = rgb2gray(img); [m,n] = size(A); %Filter Parameters setup windowSize = input('Enter window size (3/5/7):\n '); stDevSpace = input('Enter space standard deviation (1-20):\n ');
Created Jan 4, 2018
Rename filename bash
View Rename_files.txt
 num=0; for i in *; do mv "\$i" "\$(printf '%04d' \$num).\${i#*.}"; ((num++)); done
Created Jan 18, 2018
Bash command for adding prefix
 for f in * ; do mv "\$f" "PRE_\$f" ; done
Created Jan 18, 2018
This is a python script to write list characters into file
View write_labels_tofile.py
 thefile = open('train_test_data_labels.txt', 'w') for item in y_train_test_list: thefile.write("%s\n" % item)
Created Jan 18, 2018
This is a simple script to read labels from file