Giter Club home page Giter Club logo

plotai's Introduction

PlotAI logo

πŸŽ¨πŸ€– Create Python plots in matplotlib with LLM πŸŽ¨πŸ€–

πŸš€ Get Started Β Β β€’Β Β  🀝 Issues Β Β β€’Β Β  🐦 Twitter Β Β β€’Β Β  πŸ‘©β€πŸ’Ό LinkedIn

PlotAI πŸŽ¨πŸ€–

The easiest way to create plots in Python and Matplotlib. The plotai is using LLM to generate code and plots.

The idea:

  1. User provides input DataFrame and prompt.
  2. The PlotAI constructs a prompt for LLM, which contains the first 5 rows of DataFrame and the user's prompt and asks for Python code as output.
  3. Returned Python code is executed, and the plot is displayed.
PlotAI-Adults-demo.mp4

The simplest possible API for plotting:

# import packages
import pandas as pd
from plotai import PlotAI
# create some data
df = pd.DataFrame({"x":[1,2,3], "y": [4,5,6]})
# do a plot
plot = PlotAI(df)
plot.make("scatter plot")

The PlotAI class has only one method, make().

It works in Python scripts and in notebooks (Jupyter, Colab, VS Code).

PlotAI logo

πŸš€ Get started

Install plotai package:

pip install plotai

Create .env file with the OpenAI API key:

OPENAI_API_KEY=your-key-here

You can also pass the OpenAI API key in Python:

import os
os.environ["OPENAI_API_KEY"] = "your-key-here"

Import plotai and make plots:

# import PlotAI
from plotai import PlotAI

# create PlotAI object, pass pandas DataFrame as an argument
plot = PlotAI(df)

# make a plot, just tell what you want
plot.make("make a scatter plot")

More examples

Analyze the GPD dataset

PlotAI-GDP-demo.mp4

Analyze the Iris dataset

πŸ‘©β€πŸ’ΌπŸ¦ Connect with Us on LinkedIn & Twitter

Stay up-to-date with the latest updates about PlotAI πŸŽ¨πŸ€– by following us on Twitter (MLJAR Twitter) and LinkedIn (Aleksandra LinkedIn & Piotr LinkedIn). We look forward to connecting with you and hearing your thoughts, ideas, and experiences with PlotAI. Let's explore the future of AI together!

⚠️ Limitations

PlotAI is in very experimental form, below are some limitations:

  • PlotAI is using OpenAI ChatGPT-3.5-turbo for completions, it will be nice to extend to other LLMs.
  • PlotAI is sending 5 first rows from your DataFrame to OpenAI ChatGPT. If you have sensitive data, please remove/encode it before passing to PlotAI.
  • PlotAI is executing Python code returned by LLM, it can be dangerous and unsafe. It would be nice to have the option to accept the response code before execution.

πŸ›‘ Disclaimer

This project, PlotAI, is provided "as is" without any warranty, express or implied. By using this software, you agree to assume all risks associated with its use, including but not limited to data loss, system failure, or any other issues that may arise. The developers and contributors of this project do not accept any responsibility or liability for any losses, damages, or other consequences that may occur as a result of using this software.

Please note that the use of the OpenAI language models can be expensive due to its token usage. By utilizing this project, you acknowledge that you are responsible for monitoring and managing your own token usage and the associated costs. It is highly recommended to check your OpenAI API usage regularly and set up any necessary limits or alerts to prevent unexpected charges.

plotai's People

Contributors

pplonski avatar aplonska avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.