예제 #1
0
def prueba():

    # create data_frame to input
    data = DataFrame()
    # create data_frame to output
    output = DataFrame()
    # create normalizer
    normalizer = Normalizer()
    data.load_data_set("breast-cancer-wisconsin-data.csv")

    data.drop_columns_by_name(["id"])

    output.data_set = data.cut_column('diagnosis')

    data = data.data_set
    data.data_set = normalizer.normalize_data(data)

    data.join_data(output.data_set)

    rn = NeuralNetwork()
    kwargs = {"units": 2, "layers": 5, "activation": "sigmoid"}
    rn.create_model(kwargs)

    cv = KFoldCrossValidation(10, "diagnosis")
    cv.k_fold_validation(data, model=rn)
    cv.view_report()
예제 #2
0
def prueba2():
    # create data_frame to input
    input = DataFrame()
    # create data_frame to output
    output = DataFrame()
    # create normalizer
    normalizer = Normalizer()
    cv = CategoricalValues()
    input.load_data_set("Churn_Modelling.csv")
    # drop innecesary columns in the input

    input.drop_columns_by_name(["RowNumber", "CustomerId", "Surname"])

    output.data_set = input.cut_column('Exited')
    # normalizer data
    data = input.data_set
    input.data_set = normalizer.normalize_data(data)
    input.join_data(output.data_set)

    cv = KFoldCrossValidation(10, "Exited")
    cv.k_fold_validation(input)
    cv.view_report()
예제 #3
0
net_group.add_argument(
    "--funcion-activacion",
    type=str,
    default='relu',
    metavar='',
    help=
    'Define la salida de los nodos en una Red Neuronal para un conjunto de entradas dado'
)

normalizer = Normalizer()
args = parser.parse_args()
output = DataFrame()
input = DataFrame()
input.load_data_set("breast-cancer-wisconsin-data.csv")
output.data_set = input.cut_column('diagnosis')
input.drop_columns_by_name(['id'])
data = input.data_set
input.data_set = normalizer.normalize_data(data)
input.join_data(output.data_set)

validation = KFoldCrossValidation(10, 'diagnosis')

if args.arbol:
    print("Arbol has been chosen")
elif args.red_neuronal:
    model = NeuralNetwork()
    model.create_model(
        kwargs={
            "layers": args.numero_capas,
            "units": args.unidades_por_capa,
            "activation": args.funcion_activacion
예제 #4
0
    def predict(self, x_data):
        return self.model.predict(x_data)


model = NeuralNetwork()
# create data_frame to input
input = DataFrame()
# create data_frame to output
output = DataFrame()
# create normalizer
normalizer = Normalizer()

input.load_data_set("breast-cancer-wisconsin-data.csv")
# drop innecesary columns in the input
#input.view()
input.drop_columns_by_name(["id"])
#input.view()
output.data_set = input.cut_column('diagnosis')
#input.view()
# normalizer data
data = input.data_set
input.data_set = normalizer.normalize_data(data)
#input.join_data(output.data_set)
#validation = KFoldCrossValidation(10, 'diagnosis')
model.create_model(kwargs={"units": 2, "layers": 5, "activation": "sigmoid"})
print("Input: ", input.data_set)

#model.train_model(input.data_set, o utput.data_set)
#validation.k_fold_validation(input, model=model)