pandas2tensorboard 0.1.1a1

Last updated:

0 purchases

pandas2tensorboard 0.1.1a1 Image
pandas2tensorboard 0.1.1a1 Images
Add to Cart

Description:

pandas2tensorboard 0.1.1a1

Pandas2TensorBoard
Pandas2TensorBoard is a library for transforming the pandas DataFrame
into the data fomrat of TensorBoard. Pandas2TensorBoard relies on
torch utilities for the data transformation.

Installation


Regular installation via pip:
pip install pandas2tensorboard



With modin backend for pandas
pip install pandas2tensorboard[modin]



With Dask and omnisci support for pandas
pip install pandas2tensorboard[backend]



With Dask and omnisci support for pandas and modin backend for pandas
pip install pandas2tensorboard[all]



Usage
Currently the following types of export from pandas to tensorboard are
supported:

pd.DataFrame -> scalars
pd.DataFrame -> scalars with timestamp
pd.DataFrame -> scatter via hyperparameters

For initializing the pandas2tensorboard library, the current syntax of Torch's
tensorboard.SummaryWriter is used.
Examples


Exporting a regular pd.DataFrame to tensorboard by removing columns with str:
import seaborn as sns

from pandas2tensorboard import pandas2tensorboard as p2t

pt = p2t.Pandas2TensorBoard()
pt.regular_df(
sns.load_dataset("planets"),
label="planets",
remove_nan=True,
remove_str=True,
)
pt.close()



Exporting a pd.DataFrame with time column to tensorboard:
import seaborn as sns

from pandas2tensorboard import pandas2tensorboard as p2t

pt = p2t.Pandas2TensorBoard()
pt.timeseries_df(
sns.load_dataset("attention"),
time="score",
label="attention",
remove_nan=True,
remove_str=True,
time_convert=True,
)
pt.close()


The time column with name score is transformed into float with timestamp.



Exporting a pd.DataFrame with hyperparameters to tensorboard:
import seaborn as sns

from pandas2tensorboard import pandas2tensorboard as p2t

pt = p2t.Pandas2TensorBoard()
pt.scatter_df(
sns.load_dataset("anagrams"),
x_axis="subidr",
group="anagrams",
remove_nan=True,
remove_str=True,
)
pt.close()


The x-axis corresponds to hparam_dict; the dataframe without column
x_axis="subidr" corresponds to metric_dict.



Contributing
Please feel free to open an issue or create a pull request; see also contributing.
License
Check MIT

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.