This file contains hidden or 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
p=3 | |
m=1000 | |
def stringHash(txt): | |
# print len(txt) | |
txtHashList = [0L] * (len(txt) - 100) | |
for i in xrange(0, 100): | |
# print i | |
txtHashList[0] += ord(txt[i])*(p**i) |
This file contains hidden or 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
import numpy as np | |
import pandas as pd | |
from sklearn import preprocessing | |
class decisionnode: | |
def __init__(self,col=-1,value=None,results=None,tb=None,fb=None): | |
self.col=col | |
self.value=value | |
self.results=results | |
self.tb=tb |
This file contains hidden or 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
#Backpropagation algorithm written in Python by annanay25. | |
import string | |
import math | |
import random | |
class Neural: | |
def __init__(self, pattern): | |
# | |
# Lets take 2 input nodes, 3 hidden nodes and 1 output node. | |
# Hence, Number of nodes in input(ni)=2, hidden(nh)=3, output(no)=1. |
NewerOlder