Exemple #1
0
 def __init__(self, number_actions, number_sources, number_destinations, number_states,
              number_hidden_nodes_per_layer, activation_function_type, exploration_type, epsilon, alpha, gamma, beta,
              learning_rate, learning_method):
     # Create an instance of the Q_Learning class.
     self.learn = l.Learn(number_actions, number_sources, number_destinations, number_states,
                          number_hidden_nodes_per_layer, activation_function_type, exploration_type, epsilon, alpha,
                          gamma, beta, learning_rate)
     self.learning_method = learning_method
     self.number_actions = number_actions
Exemple #2
0
import criterion
import parse
import learn
import rank

if __name__ == "__main__":

    X = parse.Normalize(
        '/home/agiachris/CIBCData'
    )  # Return Dicitonary with States as Keys and databases and values
    stored_data = []
    for key in X.keys():  # Iterate over four datasets
        print(key)
        currData = X[key]
        #currData = currData[:100]								# Training spliced datasets
        stored_data += currData
        extData = parse.Extract(
            currData)  # Extract required data (doctor type, price)
        #n = criterion.Number(extData)							# Obtain optimal number of Gaussian Components
        if key == 'NY':
            score_records = learn.Learn(extData, 50,
                                        key)  # Cluster, plot, and store
        else:
            score_records = np.r_[score_records, (learn.Learn(
                extData, 50, key))]  # Cluster, plot, and store

    sorted_data = rank.Sort(
        score_records,
        stored_data)  # Rank dataset according to probability score
    rank.File1(sorted_data)  # Create csv file1
    rank.File2(sorted_data)  # Create cvs file2
import learn

l = learn.Learn("This is a learning program")
print(l.share())
Exemple #4
0
def learn_structure(D, Sc, dist = 'multinomial'):
  S = learn.Learn(D, Sc, 2, dist)
  spn.save(S, 'spn.net')
  return S
Exemple #5
0
import learn
import neuralnetwork
import os
import re

learn_path = "./new_train"
dictionary = learn.Learn(learn_path)

condition = True if True else False
amount_of_internal_layers = 1
input_len = 5
output_len = 2

important_dict = []
for i in dictionary.common:
    if dictionary.common[i] > 500:
        important_dict.append(i)

print(len(important_dict))
with open("words", "w") as f:
    f.write(" ".join(important_dict))