Sei sulla pagina 1di 5

# -*- coding: utf-8 -*-

import matplotlib.pyplot as plt


import numpy as np
from sklearn import datasets

# import some data to play with


file = ('Aeronaves.txt')
A = file

data=np.loadtxt(A,delimiter='\t',skiprows=0,usecols=[0,1,2,3,4,5])
X0=np.loadtxt(A,delimiter='\t',skiprows=0,usecols=[0])
X1=np.loadtxt(A,delimiter='\t',skiprows=0,usecols=[1])
X2=np.loadtxt(A,delimiter='\t',skiprows=0,usecols=[2])
X3=np.loadtxt(A,delimiter='\t',skiprows=0,usecols=[3])
X4=np.loadtxt(A,delimiter='\t',skiprows=0,usecols=[4])
X5=np.loadtxt(A,delimiter='\t',skiprows=0,usecols=[5])

plt.plot(X0,'.',label="Descriptor 1: Numero de motores")


plt.xlabel('Numero de Muestras')

plt.ylabel('Numero de Motores')
plt.legend()
plt.show()

plt.plot(X1,'.',label="Descriptor 2: Longitud")
plt.xlabel('Numero de Muestras')

plt.ylabel('Longitud')
plt.legend()
plt.show()

plt.plot(X2,'.',label="Descriptor 3: Envergadura")
plt.xlabel('Numero de Muestras')

plt.ylabel('Envergadura')
plt.legend()
plt.show()

plt.plot(X3,'.',label="Descriptor 4: Peso Vacio")


plt.xlabel('Numero de Muestras')

plt.ylabel('Peso Vacio')
plt.legend()
plt.show()

plt.plot(X4,'.',label="Descriptor 5: Velocidad Maxima")


plt.xlabel('Numero de Muestras')

plt.ylabel('Velocidad Maxima')
plt.legend()
plt.show()

plt.plot(X5,'.',label="Descriptor 6: Techo de vuelo ")


plt.xlabel('Numero de Muestras')

plt.ylabel('Techo de Vuelo')
plt.legend()
plt.show()
#X = np.data[:, :5] # we only take the first two features.
#Y = np.target
groups = ("Combate","Civil","Comercial")

# Datos Numero de motores


NM=X0
#clase 0_ Aeronaves Combate:
NM_0=NM[0:49]
#clase 1_ Aeronaves civiles:
NM_1=NM[50:99]
#clase 2_ Aeronaves Comerciales:
NM_2=NM[100:149]

# Datos Longitud
L=X1
#clase 0_ Aeronaves Combate:
L_0=L[0:49]
#clase 1_ Aeronaves civiles:
L_1=L[50:99]
#clase 2_ Aeronaves Comerciales:
L_2=L[100:149]

# Datos Envergadura
EN=X2
#clase 0_ Aeronaves Combate:
EN_0=EN[0:49]
#clase 1_ Aeronaves civiles:
EN_1=EN[50:99]
#clase 2_ Aeronaves Comerciales:
EN_2=EN[100:149]

# Datos Peso Vacio


PV=X3
#clase 0_ Aeronaves Combate:
PV_0=PV[0:49]
#clase 1_ Aeronaves civiles:
PV_1=PV[50:99]
#clase 2_ Aeronaves Comerciales:
PV_2=PV[100:149]

# Datos Velocidad Maxima


VM=X4
#clase 0_ Aeronaves Combate:
VM_0=VM[0:49]
#clase 1_ Aeronaves civiles:
VM_1=VM[50:99]
#clase 2_ Aeronaves Comerciales:
VM_2=VM[100:149]

# Datos Techo de vuelo


TV=X5
#clase 0_ Aeronaves Combate:
TV_0=TV[0:49]
#clase 1_ Aeronaves civiles:
TV_1=TV[50:99]
#clase 2_ Aeronaves Comerciales:
TV_2=TV[100:149]
#************************************Gaussian
distribution:*********************************************

from scipy.stats import norm

#Numero de motores
#Means:
NM_0mean=np.mean(NM_0); NM_1mean=np.mean(NM_1);
NM_2mean=np.mean(NM_2)
#Std:
NM_0std=np.std(NM_0); NM_1std=np.std(NM_1); NM_2std=np.std(NM_2)

NM_d0 = norm(loc = NM_0mean, scale=NM_0std)


NM_d1 = norm(loc = NM_1mean, scale=NM_1std)
NM_d2 = norm(loc = NM_2mean, scale=NM_2std)
P1 = np.arange(0, 10, .1)

#plot the pdfs of these normal distributions


plt.figure(1, figsize=(8, 6))
plt.clf()
plt.plot(P1, NM_d0.pdf(P1), P1 , NM_d1.pdf(P1), P1 , NM_d2.pdf(P1) )
plt.title("Numero de motores")

# longitud
#Means:
L_0mean=np.mean(L_0); L_1mean=np.mean(L_1); L_2mean=np.mean(L_2)

#Std:
L_0std=np.std(L_0); L_1std=np.std(L_1); L_2std=np.std(L_2)

L_d0 = norm(loc = L_0mean, scale=L_0std)


L_d1 = norm(loc = L_1mean, scale=L_1std)
L_d2 = norm(loc = L_2mean, scale=L_2std)
P1 = np.arange(0, 100, .1)

#plot the pdfs of these normal distributions


plt.figure(2, figsize=(8, 6))
plt.clf()
plt.plot(P1, L_d0.pdf(P1), P1 , L_d1.pdf(P1), P1 , L_d2.pdf(P1) )
plt.title("Longitud")

#Envergadura
#Means:
EN_0mean=np.mean(EN_0); EN_1mean=np.mean(EN_1);
EN_2mean=np.mean(EN_2)
#Std:
EN_0std=np.std(EN_0); EN_1std=np.std(EN_1); EN_2std=np.std(EN_2)

EN_d0 = norm(loc = EN_0mean, scale=EN_0std)


EN_d1 = norm(loc = EN_1mean, scale=EN_1std)
EN_d2 = norm(loc = EN_2mean, scale=EN_2std)
P1 = np.arange(0, 50, .1)

#plot the pdfs of these normal distributions


plt.figure(3, figsize=(8, 6))
plt.clf()
plt.plot(P1, EN_d0.pdf(P1), P1 , EN_d1.pdf(P1), P1, EN_d2.pdf(P1) )
plt.title("Envergadura")

#Peso Vacio
#Means:
PV_0mean=np.mean(PV_0); PV_1mean=np.mean(PV_1);
PV_2mean=np.mean(PV_2)
#Std:
PV_0std=np.std(PV_0); PV_1std=np.std(PV_1); PV_2std=np.std(PV_2)

PV_d0 = norm(loc = PV_0mean, scale=PV_0std)


PV_d1 = norm(loc = PV_1mean, scale=PV_1std)
PV_d2 = norm(loc = PV_2mean, scale=PV_2std)
P1 = np.arange(0, 1000000, 100)

#plot the pdfs of these normal distributions


plt.figure(4, figsize=(8, 6))
plt.clf()
plt.plot(P1, PV_d0.pdf(P1), P1 , PV_d1.pdf(P1), P1, PV_d2.pdf(P1) )
plt.title("Peso vacio ")

#Velocidad Msxima
#Means:
VM_0mean=np.mean(VM_0); VM_1mean=np.mean(VM_1);
VM_2mean=np.mean(VM_2)
#Std:
VM_0std=np.std(VM_0); VM_1std=np.std(VM_1); VM_2std=np.std(VM_2)

VM_d0 = norm(loc = VM_0mean, scale=VM_0std)


VM_d1 = norm(loc = VM_1mean, scale=VM_1std)
VM_d2 = norm(loc = VM_2mean, scale=VM_2std)
P1 = np.arange(0, 10000, .1)

#plot the pdfs of these normal distributions


plt.figure(5, figsize=(8, 6))
plt.clf()
plt.plot(P1, VM_d0.pdf(P1), P1 , VM_d1.pdf(P1), P1, VM_d2.pdf(P1) )
plt.title("Velocidad Maxima ")

#Techo de vuelo
#Means:
TV_0mean=np.mean(TV_0); TV_1mean=np.mean(TV_1);
TV_2mean=np.mean(TV_2)
#Std:
TV_0std=np.std(TV_0); TV_1std=np.std(TV_1); TV_2std=np.std(TV_2)

TV_d0 = norm(loc = TV_0mean, scale=TV_0std)


TV_d1 = norm(loc = TV_1mean, scale=TV_1std)
TV_d2 = norm(loc = TV_2mean, scale=TV_2std)
P1 = np.arange(0, 100000, .1)

#plot the pdfs of these normal distributions


plt.figure(6, figsize=(8, 6))
plt.clf()
plt.plot(P1, TV_d0.pdf(P1), P1 , TV_d1.pdf(P1), P1, TV_d2.pdf(P1) )
plt.title("Techo de vuelo ")

Potrebbero piacerti anche