bibliotecas
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
from spectralforensics import bar_plot
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
bar_plot(
|
||||
{"model": ["A", "B", "A", "B"],
|
||||
"spectral_entropy": [2.1, 2.5, 2.2, 2.9],
|
||||
"anisotropy": [0.1, -0.3, 0.2, 0.4]},
|
||||
x="model", y="spectral_entropy",
|
||||
title="Análise espectral — barras",
|
||||
)
|
||||
@@ -0,0 +1,8 @@
|
||||
from spectralforensics import box_plot
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
dataset = {"income": ["<=50K", "<=50K", "<=50K", ">50K", ">50K", ">50K"],
|
||||
"hours-per-week": [30, 40, 45, 40, 50, 60]}
|
||||
box_plot(dataset, x="income", y="hours-per-week",
|
||||
fill=False, gap=.1, palette="pastel")
|
||||
@@ -0,0 +1,12 @@
|
||||
from spectralforensics import correlation_plot
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
result = correlation_plot(
|
||||
{"entropy": [2.1, 2.5, 2.2, 2.9, 2.6],
|
||||
"anisotropy": [0.1, 0.3, 0.2, 0.4, 0.25],
|
||||
"target": [0, 1, 0, 1, 1]},
|
||||
correlation_columns=["entropy", "anisotropy", "target"],
|
||||
method="pearson", cmap="coolwarm", center=0, annot=True, fmt=".2f",
|
||||
target="target", kind="barh", by="target",
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
from spectralforensics import line_plot
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
line_plot(
|
||||
{"sample": [1, 2, 3, 4, 5],
|
||||
"spectral_entropy": [2.1, 2.5, 2.2, 2.9, 2.6],
|
||||
"anisotropy": [0.1, 0.3, 0.2, 0.4, 0.25]},
|
||||
x="sample", y="spectral_entropy",
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
from spectralforensics import scatter_plot
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
scatter_plot(
|
||||
{"dominant_frequency": [1, 2, 2, 3, 4],
|
||||
"anisotropy": [0.1, 0.3, 0.2, 0.4, 0.25],
|
||||
"spectral_entropy": [2.1, 2.5, 2.2, 2.9, 2.6]},
|
||||
x="dominant_frequency", y="anisotropy",
|
||||
title="Análise espectral — dispersão",
|
||||
)
|
||||
Reference in New Issue
Block a user