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
# -*- coding: utf-8 -*- | |
def calcula_lado_linea(x0, x1, x2, y0, y1, y2): | |
valor = (x1 - x0) * (y2 - y0) - (x2 - x0) * (y1 - y0) | |
if valor > 0 and valor >= (1 * 10**(-10)): | |
aux_valor = 1 | |
elif valor > 0 and valor < (1 * 10**(-10)): | |
aux_valor = 0 | |
elif valor < 0 and abs(valor) < (1 * 10**(-10)): | |
aux_valor = 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import math | |
import sys | |
class Graph: | |
def __init__(self): | |
self.size = 0 | |
self.vertices = { } |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# --------------------------LIBRERIAS-------------------------- # | |
# ------------------------------------------------------------- # | |
import numpy as np | |
# ------------------------------------------------------------- # | |
# -------------------------FUNCIONES--------------------------- # | |
def generate_random_points_2D(num_puntos, media, mat_cov): | |
aux_arr = [] | |
for i in range(num_puntos): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# --------------------------LIBRERIAS-------------------------- # | |
# ------------------------------------------------------------- # | |
import numpy as np | |
# ------------------------------------------------------------- # | |
# -------------------------FUNCIONES--------------------------- # | |
def generate_random_points_2D(num_puntos, media, mat_cov): | |
aux_arr = [] | |
for i in range(num_puntos): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# --------------------------LIBRERIAS-------------------------- # | |
# ------------------------------------------------------------- # | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# ------------------------------------------------------------- # | |
# ---------------------------CLASES---------------------------- # | |
class KNearest: | |
def __init__(self, num_datos, knear): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# --------------------------LIBRERIAS-------------------------- # | |
# ------------------------------------------------------------- # | |
import Matrix_Operations as matope | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# ------------------------------------------------------------- # | |
# -------------------------FUNCIONES--------------------------- # | |
def generate_random_points_2D(clase, num_puntos, media, mat_cov): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# --------------------------LIBRERIAS-------------------------- # | |
# ------------------------------------------------------------- # | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# ------------------------------------------------------------- # | |
# -------------------------FUNCIONES--------------------------- # | |
class perceptron: | |
def __init__(self, num_datos): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# --------------------------LIBRERIAS-------------------------- # | |
# ------------------------------------------------------------- # | |
import copy | |
import random as rand | |
import matplotlib.pyplot as plt | |
# ------------------------------------------------------------- # | |
# ---------------------------CLASES---------------------------- # | |
class Estructura2D: |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# --------------------------LIBRERIAS-------------------------- # | |
# ------------------------------------------------------------- # | |
import time | |
import numpy as np | |
from itertools import izip_longest, imap | |
import matplotlib.pyplot as plt | |
import random as rand | |
# ------------------------------------------------------------- # |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# --------------------------LIBRERIAS-------------------------- # | |
# ------------------------------------------------------------- # | |
import random as rand | |
import matplotlib.pyplot as plt | |
# ------------------------------------------------------------- # | |
# ---------------------------CLASES---------------------------- # | |
class Node: | |
def __init__(self, val): |
NewerOlder