-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7a6831
commit 99bd88a
Showing
60 changed files
with
197 additions
and
30 deletions.
There are no files selected for viewing
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import calculos as c | ||
import os | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
movie="Men in black" | ||
m="moviesdata" | ||
g="actordata" | ||
s='/' | ||
apidata=os.listdir(m+s+movie) | ||
actordata=os.listdir(g+s+movie) | ||
print(movie) | ||
print(apidata) | ||
print(actordata) | ||
DM=2 # 0.0 distancia minima posible | ||
AM=1 # 1.0 angle maxim posible | ||
|
||
x=[] | ||
y=[] | ||
while AM>=0: | ||
|
||
AM=AM-0.01 | ||
# DM=1.2 | ||
x.append(AM) | ||
|
||
for unkownactor in apidata: | ||
act=c.extraerSublistaArchivo(m+s+movie+s+unkownactor) | ||
# print("\n") | ||
# print('{} subcaras para el actor {}'.format(len(act),unkownactor.strip('.txt'))) | ||
for subactor in actordata: | ||
currentactor=c.extraerSublistaArchivo(g+s+movie+s+subactor) | ||
count=0 | ||
for subcara in act: | ||
for caratest in currentactor: | ||
if(c.similitudCoseno(caratest,subcara)>AM): | ||
if(c.distanciaEuclidea(caratest,subcara)<DM): | ||
count=count+1 | ||
if(count>0): | ||
print('{} true per {}, {} vegades amb AM: {}'.format(subactor.strip('.txt'),unkownactor.strip('.txt'),count,AM)) | ||
y.append(count) | ||
else: | ||
y.append(0) | ||
# pass | ||
# print("no hi han cares valides per els coeficients AM : {} i DM: {} per l'actor {}".format(AM,DM,subactor.strip('.txt'))) | ||
# DM=50 | ||
# plt.style.use('bmh') | ||
|
||
plt.plot(x,y) | ||
plt.title(actordata[0].strip(".txt")) | ||
plt.xlabel("Coeficiente AM") | ||
plt.ylabel("Verdaderos positivos") | ||
plt.grid() | ||
plt.show() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import calculos as c | ||
import os | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
movie="Men in black" | ||
m="moviesdata" | ||
g="actordata" | ||
s='/' | ||
apidata=os.listdir(m+s+movie) | ||
actordata=os.listdir(g+s+movie) | ||
print(movie) | ||
print(apidata) | ||
print(actordata) | ||
DM=0.0 # 0.0 distancia minima posible | ||
AM=0 # 1.0 angle maxim posible | ||
|
||
x=[] | ||
y=[] | ||
while DM<2: | ||
|
||
DM=DM+0.01 | ||
# DM=1.2 | ||
x.append(DM) | ||
|
||
for unkownactor in apidata: | ||
act=c.extraerSublistaArchivo(m+s+movie+s+unkownactor) | ||
# print("\n") | ||
# print('{} subcaras para el actor {}'.format(len(act),unkownactor.strip('.txt'))) | ||
for subactor in actordata: | ||
currentactor=c.extraerSublistaArchivo(g+s+movie+s+subactor) | ||
count=0 | ||
for subcara in act: | ||
for caratest in currentactor: | ||
if(c.similitudCoseno(caratest,subcara)>AM): | ||
if(c.distanciaEuclidea(caratest,subcara)<DM): | ||
count=count+1 | ||
if(count>0): | ||
print('{} true per {}, {} vegades amb DM: {}'.format(subactor.strip('.txt'),unkownactor.strip('.txt'),count,DM)) | ||
y.append(count) | ||
else: | ||
y.append(0) | ||
# pass | ||
# print("no hi han cares valides per els coeficients AM : {} i DM: {} per l'actor {}".format(AM,DM,subactor.strip('.txt'))) | ||
# DM=50 | ||
# plt.style.use('bmh') | ||
|
||
plt.plot(x,y) | ||
plt.title(actordata[0].strip(".txt")) | ||
plt.xlabel("Coeficiente DM") | ||
plt.ylabel("Verdaderos positivos") | ||
plt.grid() | ||
plt.show() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import calculos as c | ||
import os | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
movie="Men in black" | ||
m="moviesdata" | ||
g="actordata" | ||
s='/' | ||
apidata=os.listdir(m+s+movie) | ||
actordata=os.listdir(g+s+movie) | ||
print(movie) | ||
print(apidata) | ||
print(actordata) | ||
DM=0.0 # 0.0 distancia minima posible | ||
AM=0 # 1.0 angle maxim posible | ||
|
||
x=[] | ||
y=[] | ||
DM=0.0 # 0.0 distancia minima posible | ||
AM=0 # 1.0 angle maxim posible | ||
while DM<2: | ||
|
||
DM=DM+0.01 | ||
# DM=1.2 | ||
x.append(DM) | ||
|
||
for unkownactor in apidata: | ||
act=c.extraerSublistaArchivo(m+s+movie+s+unkownactor) | ||
# print("\n") | ||
# print('{} subcaras para el actor {}'.format(len(act),unkownactor.strip('.txt'))) | ||
for subactor in actordata: | ||
currentactor=c.extraerSublistaArchivo(g+s+movie+s+subactor) | ||
count=0 | ||
for subcara in act: | ||
for caratest in currentactor: | ||
if(c.similitudCoseno(caratest,subcara)>AM): | ||
if(c.distanciaEuclidea(caratest,subcara)<DM): | ||
count=count+1 | ||
if(count>0): | ||
print('{} true per {}, {} vegades amb DM: {}'.format(subactor.strip('.txt'),unkownactor.strip('.txt'),count,DM)) | ||
y.append(count) | ||
else: | ||
y.append(0) | ||
# pass | ||
# print("no hi han cares valides per els coeficients AM : {} i DM: {} per l'actor {}".format(AM,DM,subactor.strip('.txt'))) | ||
# DM=50 | ||
# plt.style.use('bmh') | ||
n=[] | ||
z=[] | ||
DM=2 # 0.0 distancia minima posible | ||
AM=1 # 1.0 angle maxim posible | ||
while AM>=0: | ||
|
||
AM=AM-0.01 | ||
# DM=1.2 | ||
n.append(AM) | ||
|
||
for unkownactor in apidata: | ||
act=c.extraerSublistaArchivo(m+s+movie+s+unkownactor) | ||
# print("\n") | ||
# print('{} subcaras para el actor {}'.format(len(act),unkownactor.strip('.txt'))) | ||
for subactor in actordata: | ||
currentactor=c.extraerSublistaArchivo(g+s+movie+s+subactor) | ||
count=0 | ||
for subcara in act: | ||
for caratest in currentactor: | ||
if(c.similitudCoseno(caratest,subcara)>AM): | ||
if(c.distanciaEuclidea(caratest,subcara)<DM): | ||
count=count+1 | ||
if(count>0): | ||
print('{} true per {}, {} vegades amb AM: {}'.format(subactor.strip('.txt'),unkownactor.strip('.txt'),count,AM)) | ||
z.append(count) | ||
else: | ||
z.append(0) | ||
# pass | ||
# print("no hi han cares valides per els coeficients AM : {} i DM: {} per l'actor {}".format(AM,DM,subactor.strip('.txt'))) | ||
# DM=50 | ||
# plt.style.use('bmh') | ||
|
||
plt.plot(x,y,label="DM") | ||
plt.plot(n,z,label="AM") | ||
plt.title(actordata[0].strip(".txt")) | ||
plt.xlabel("Coeficiente DM AM") | ||
plt.ylabel("Verdaderos positivos") | ||
plt.grid() | ||
plt.legend() | ||
plt.show() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.