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
#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 |
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
#include <iostream> | |
#include <opencv2/highgui/highgui.hpp> | |
#include <opencv2/imgproc/imgproc.hpp> | |
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 |
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
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 '); |
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
num=0; for i in *; do mv "$i" "$(printf '%04d' $num).${i#*.}"; ((num++)); done |
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
for f in * ; do mv "$f" "PRE_$f" ; done |
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
thefile = open('train_test_data_labels.txt', 'w') | |
for item in y_train_test_list: | |
thefile.write("%s\n" % item) |
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
array = [] | |
with open('train_test_data_labels.txt') as fileobj: | |
for line in fileobj: | |
for ch in line: | |
array.append(ch) | |
#print(ch) | |
new_list = [a for a in array if a != '\n'] |
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
xcopy C:\Folders D:\Folders /t /e |
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
# After installation of PuTTY, open command window prompt and type the following: | |
//For copying folder: | |
pscp -r source destination | |
//For copying file: | |
pscp source destination |
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
#This is an example how to run multiple bash commands together | |
# Just put && symbol between commands | |
cd o_cheek/ && num=0; for i in *; do mv "$i" "$(printf 'cheek_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_cheek cheek_old && cd o_eye/ && num=0; for i in *; do mv "$i" "$(printf 'eye_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_eye eye_old && cd o_forearm/ && num=0; for i in *; do mv "$i" "$(printf 'forearm_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_forearm forearm_old && cd y_cheek/ && num=0; for i in *; do mv "$i" "$(printf 'cheek_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_cheek cheek_young && cd y_eye/ && num=0; for i in *; do mv "$i" "$(printf 'eye_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_eye eye_young && cd y_forearm/ && num=0; for i in *; do mv "$i" "$(printf 'forearm_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_forearm forearm_young |
OlderNewer