Coder Social home page Coder Social logo

flowa.patch's Introduction

flowa

License Python Versions

flowa: (V1.2.3)

Python Machine Learning, Image Generation, Decision Trees, Label Encoders, and more!

Installing

# Linux/macOS
python3 pip install -U flowa

# Windows
py -3 -m pip install -U flowa

Simple Examples

from flowa import (
    Encoder,
    Tree,
    Dataset,
    read_csv,
    convert
)

classifier: Tree = Tree()
encoder: Encoder = Encoder()

dataset: str = convert(Dataset.get_music_data())
csv: object = read_csv(dataset)

dataframe: object = encoder.df(csv, 'gender')

X_matrix: object = dataframe.drop('genre', axis=1).values
y_column: object = encoder(dataframe['genre'].values)

classifier.fit(X_matrix, y_column)

age, gender = encoder.new(30, 'female')
fix: list = encoder.fix(age, gender)

prediction: list[int] = classifier.predict(fix)
print(encoder.inverse(prediction))

#>>> ['Pop']

Image generation:

model: ImageModel[object] = ImageModel()
image: ImageModel[str] = model.generate(
    prompt="a cat", model="pixart", width=512, height=512, logo=False
).save("some-file.png")

#>>> flowa.types.Image

String Dataset to dataframe conversion:

from flowa import (
    Dataset,
    read_csv,
    convert
)

dataset: Dataset = Dataset.get_play_tennis()

converted_dataset: str = convert(dataset)

csv: Dataset = read_csv(converted_dataset)
print(csv)

#>>>     Outlook Temperature Humidity    Wind Play Tennis
#>>> 0  Overcast        Mild   Normal    Weak         Yes
#>>> 1     Sunny        Mild   Normal    Weak         Yes
#>>> ... [2 rows not shown]

Links

flowa.patch's People

Contributors

flowa-ai 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.