示例#1
0
    point = {0: 'ro', 1: 'bo'}
    marker = {0: 's', 1: 'D'}

    # O clasificador da vigesima realização
    plot_dict = {
        'xx': xx,
        'yy': yy,
        'Z': array(best_acc_clf.predict(space)),
        'classes': {}
    }

    # utilizando o x_test e o y_test da ultima realização
    for c in [0, 1]:
        plot_dict['classes'].update({
            c: {
                'X': x_test[where(y_test == c)[0]],
                'point': point[c],
                'marker': marker[c]
            }
        })

    # #FFAAAA red
    # #AAAAFF blue
    coloring(plot_dict,
             ListedColormap(['#FFAAAA', '#AAAAFF']),
             xlabel='x1',
             ylabel='x2',
             title='mapa de cores com knn',
             path=path + 'color_map_and_knn.jpg',
             save=True)
    print('dataset shape %s' % Counter(base[:, 2]))
示例#2
0
    # utilizando o x_test e o y_test da ultima realização
    for c in [0, 1, 2]:
        plot_dict['classes'].update({
            c: {
                'X': x[where(y == c)[0]],
                'point': point[c],
                'marker': marker[c]
            }
        })

    # #FFAAAA red
    # #AAAAFF blue
    coloring(plot_dict,
             ListedColormap(['#87CEFA', '#228B22', "#FF00FF"]),
             xlabel='x1',
             ylabel='x2',
             title='mapa de cores com Rede Perceptron ',
             xlim=[-0.1, 1.1],
             ylim=[-0.1, 1.1],
             path=get_project_root() + '/run/TR-04/ARTIFICIAL/results/' +
             'color_map_triangle_simple_net.jpg',
             save=True)
    # print('dataset shape %s' % Counter(base[:, 2]))

    print(pd.DataFrame(final_result))
    # del final_result['best_cf']
    pd.DataFrame(final_result).to_csv(get_project_root() +
                                      '/run/TR-04/ARTIFICIAL/results/' +
                                      'result_simple_net.csv')
        'classes': {}
    }

    # utilizando o x_test e o y_test da ultima realização
    for c in [0, 1]:
        plot_dict['classes'].update({
            c: {
                'X': x_test[where(y_test == c)[0]],
                'point': point[c],
                'marker': marker[c]
            }
        })

    # #FFAAAA red
    # #AAAAFF blue
    coloring(plot_dict,
             ListedColormap(['#FFAAAA', '#AAAAFF']),
             xlabel='x1',
             ylabel='x2',
             title='mapa de cores com Perceptron sigmoid',
             path=get_project_root() + '/run/TR-035/ARTIFICIAL/results/' +
             'color_map_triangle_sigmoid_hyper_net.jpg',
             save=True)
    # print('dataset shape %s' % Counter(base[:, 2]))

    print(pd.DataFrame(final_result))
    # del final_result['best_cf']
    pd.DataFrame(final_result).to_csv(get_project_root() +
                                      '/run/TR-035/ARTIFICIAL/results/' +
                                      'result_sigmoid_hyper_net.csv')
示例#4
0
    # utilizando o x_test e o y_test da ultima realização
    for c in [0, 1]:
        plot_dict['classes'].update({
            c: {
                'X': x[where(y == c)[0]],
                'point': point[c],
                'marker': marker[c]
            }
        })

    # #FFAAAA red
    # #AAAAFF blue
    coloring(plot_dict,
             ListedColormap(['#87CEFA', '#228B22']),
             xlabel='x1',
             ylabel='x2',
             title='mapa de cores com RBF',
             xlim=[-0.1, 1.1],
             ylim=[-0.1, 1.1],
             path=get_project_root() + '/run/TR-06/XOR/results/' +
             'color_map_xor_rbf_net.jpg',
             save=True)
    # print('dataset shape %s' % Counter(base[:, 2]))

    print(pd.DataFrame(final_result))
    # del final_result['best_cf']
    pd.DataFrame(final_result).to_csv(get_project_root() +
                                      '/run/TR-06/XOR/results/' +
                                      'result_rbf.csv')
示例#5
0
        2: '*'
    }

    # O clasificador da vigesima realização
    plot_dict = {
        'xx': xx,
        'yy': yy,
        'Z': out_of_c_to_label(simple_net.predict(space)),
        'classes': {}
    }

    # utilizando o x_test e o y_test da ultima realização
    for c in [0, 1, 2]:
        plot_dict['classes'].update({
            c: {
                'X': x[where(y == c)[0]],
                'point': point[c],
                'marker': marker[c]
            }
        })

    # #FFAAAA red
    # #AAAAFF blue
    coloring(plot_dict, ListedColormap(['#87CEFA', '#228B22', "#FF00FF"]), xlabel='SepalLengthCm', ylabel='SepalWidthCm',
             title='mapa de cores com Rede Perceptron', xlim=[-0.1, 1.1], ylim=[-0.1, 1.1],
             path=get_project_root() + '/run/TR-03/IRIS/results/' + 'color_map_sepal.jpg', save=True)
    # print('dataset shape %s' % Counter(base[:, 2]))



示例#6
0
            }
            marker = {
                0: '^',
                1: 'o',
            }

            # O clasificador da vigesima realização
            plot_dict = {
                'xx': xx,
                'yy': yy,
                'Z': classifier_perceptron.predict(space),
                'classes': {}
            }

            # utilizando o x_test e o y_test da ultima realização
            for c in [0, 1]:
                plot_dict['classes'].update({
                    c: {
                        'X': x[where(y == c)[0]],
                        'point': point[c],
                        'marker': marker[c]
                    }
                })

            path = get_project_root() + '/run/TR-035/IRIS/results/' + 'color_map_' + str(combination) + str(one_versus_others) + '.jpg'
            coloring(plot_dict, ListedColormap(['#87CEFA', '#228B22']), xlabel=combination[0],
                     ylabel=combination[1], title='mapa de cores com Rede Perceptron' + str(one_versus_others),
                     xlim=[-0.1, 1.1], ylim=[-0.1, 1.1],
                     path=path,
                     save=True)
示例#7
0
    }

    # utilizando o x_test e o y_test da ultima realização
    for c in [0, 1, 2]:
        plot_dict['classes'].update({
            c: {
                'X': x[where(y == c)[0]],
                'point': point[c],
                'marker': marker[c]
            }
        })

    # #FFAAAA red
    # #AAAAFF blue
    coloring(plot_dict, ListedColormap(['#87CEFA', '#228B22', "#FF00FF"]), xlabel='SepalLengthCm',
             ylabel='SepalWidthCm',
             title='mapa de cores com Rede Perceptron - ACC: ' + str(metric_results['ACCURACY'].round(2)), xlim=[-0.1, 1.1], ylim=[-0.1, 1.1],
             path=get_project_root() + '/run/TR-04/IRIS/results/' + 'color_map_sepal_test.jpg', save=True)
    # print('dataset shape %s' % Counter(base[:, 2]))

    # ------------------ All points -------------------------------------------------------------------

    x = array(base[:, :2])
    y = array(out_of_c_to_label(base[:, 2:]))


    xx, yy = generate_space(x)
    space = c_[xx.ravel(), yy.ravel()]

    point = {
        0: 'bo',
        1: 'go',
示例#8
0
        'classes': {}
    }

    # utilizando o x_test e o y_test da ultima realização
    for c in [0, 1]:
        plot_dict['classes'].update({
            c: {
                'X': x_test[where(y_test == c)[0]],
                'point': point[c],
                'marker': marker[c]
            }
        })

    # #FFAAAA red
    # #AAAAFF blue
    coloring(plot_dict,
             ListedColormap(['#FFAAAA', '#AAAAFF']),
             xlabel='x1',
             ylabel='x2',
             title='mapa de cores com perceptron',
             path=get_project_root() + '/run/TR-01/ARTIFICIAL/results/' +
             'color_map_and_percptron.jpg',
             save=True)
    print('dataset shape %s' % Counter(base[:, 2]))

    del final_result['best_cf']
    del final_result['ErrosxEpocohs']

    DataFrame(final_result).to_csv(get_project_root() +
                                   '/run/TR-01/ARTIFICIAL/results/' +
                                   'result_percptron.csv')