Skip to main content

A friendly machine learning framework with shark-themed feedback 🦈

Project description

🦈 SharkPy

A friendly machine learning framework with shark-themed feedback! SharkPy simplifies the machine learning workflow while making it fun and educational.

Features

  • Model Battle Arena: Compare multiple models automatically
  • Smart Reporting: Generate reports in TXT, PDF, and DOCX formats
  • Interactive Visualization: Beautiful plots with shark-themed styling
  • Model Explanations: Clear explanations of model behavior
  • Automated Optimization: Hyperparameter tuning with Optuna
  • Shapash Integration: Interactive dashboards for model interpretation

Quick Start

Installation

# Basic installation
pip install sharkpy

# Full installation (includes LightGBM and CatBoost)
pip install sharkpy[full]

# Development installation
pip install sharkpy[dev]

Basic Usage

from sharkpy import Shark
import pandas as pd

# Create a Shark instance
shark = Shark()

# Load your data
data = pd.read_csv('your_data.csv')

# Train a model
shark.learn(
    data=data,
    target='target_column',
    model_choice='random_forest'
)

# Make predictions
predictions = shark.predict(new_data)

# Generate reports
shark.report(export_path='report.pdf', format='pdf')

Model Battle Example

# Define models to compete
models = [
    'linear_regression',
    'random_forest',
    'xgboost',
    'lightgbm',
    'catboost'
]

# Let them battle!
battle_results = shark.battle(
    data=data,
    target='target_column',
    models=models,
    metric='r2'
)

# Get the champion
print(f"Winner: {battle_results['champion']}")
print(f"Score: {battle_results['score']:.4f}")

Supported Models

  • Linear Regression
  • Logistic Regression
  • Random Forest
  • Support Vector Machines
  • Ridge Regression
  • Lasso Regression
  • K-Nearest Neighbors
  • XGBoost
  • LightGBM (with full installation)
  • CatBoost (with full installation)

Reports

SharkPy can generate comprehensive reports in multiple formats:

# Text report
shark.report(export_path='report.txt', format='txt')

# PDF report (requires MS Word or LibreOffice)
shark.report(export_path='report.pdf', format='pdf')

# Word document
shark.report(export_path='report.docx', format='docx')

Visualizations

# Prediction plot
shark.plot(kind="prediction")

# Feature importance
shark.plot(kind="feature_importance")

# Interactive Shapash dashboard
shark.explain_with_shapash()

Model Explanations

# Get friendly explanations of your model
shark.explain()

# Create interactive Shapash dashboard
shark.explain_with_shapash(title_story="My Analysis")

Save & Load Models

# Save your model
shark.save_model(name="my_model")

# Load a saved model
shark.load_model("models/my_model.joblib")

Development

# Install development dependencies
pip install sharkpy[dev]

# Run tests
pytest

# Format code
black sharkpy/

Documentation

Full documentation is available at sharkpy.readthedocs.io

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built with scikit-learn, XGBoost, and other amazing open-source tools
  • Inspired by making machine learning more accessible and fun

Contact


Made with 🦈 by SharkPy Team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sharkpy-1.0.1.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sharkpy-1.0.1-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file sharkpy-1.0.1.tar.gz.

File metadata

  • Download URL: sharkpy-1.0.1.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for sharkpy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e0bdfecaa6defc9d30f400b6e597ce0bac442f15a00a5ca09d86150e39c4785a
MD5 34e9fe4ac6215b60bb02979c16c66db3
BLAKE2b-256 ded05dace448b2a53be080d4d8d8b98939c448ddd96865658934e1d34ce31db7

See more details on using hashes here.

File details

Details for the file sharkpy-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sharkpy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for sharkpy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 923c349712e5bf36d14ab8d700513c7a79146279aa0908d9ca5e9d7feda3f14e
MD5 d8a2b9b55059a20a8488fc22afa99c52
BLAKE2b-256 fa728b7da07b6e50f901913967fc3c81e9dbcc60f9f1230118a40545fe328f55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page