mirror of
https://github.com/Doctorado-ML/bayesclass.git
synced 2025-08-15 23:55:57 +00:00
27 lines
658 B
Python
27 lines
658 B
Python
"""
|
|
=============================
|
|
Plotting Template Transformer
|
|
=============================
|
|
|
|
An example plot of :class:`bayesclass.template.TemplateTransformer`
|
|
"""
|
|
import numpy as np
|
|
from matplotlib import pyplot as plt
|
|
from bayesclass import TemplateTransformer
|
|
|
|
X = np.arange(50, dtype=np.float).reshape(-1, 1)
|
|
X /= 50
|
|
estimator = TemplateTransformer()
|
|
X_transformed = estimator.fit_transform(X)
|
|
|
|
plt.plot(X.flatten(), label="Original Data")
|
|
plt.plot(X_transformed.flatten(), label="Transformed Data")
|
|
plt.title("Plots of original and transformed data")
|
|
|
|
plt.legend(loc="best")
|
|
plt.grid(True)
|
|
plt.xlabel("Index")
|
|
plt.ylabel("Value of Data")
|
|
|
|
plt.show()
|