Skip to main content

modlee package

Project description

Quickstart with Modlee

Welcome to Modlee! This guide will help you get up and running quickly with Modlee, whether you're new to machine learning or just new to our platform.

Account Setup

Sign up for a Modlee account if you haven’t already or sign in to access your account.


Python Setup

1. Install Python

To use the Modlee package, you'll need to have Python installed on your computer. To download Python, visit the official Python website and download the latest version. To use the Modlee package, you need at least Python 3.10 or newer. If this is your first time downloading Python, please refer to the official Python installation guide for beginners.

2. Set Up a Virtual Environment (Optional but Recommended)

Creating a virtual environment helps to manage project-specific dependencies and avoid conflicts between different projects.

  • Creating a Virtual Environment: To create a virtual environment, open your terminal or command prompt and navigate to your project directory. Run the following command:

    python -m venv myenv
    

    This command creates a directory named myenv (you can choose any name) in your project folder, containing a copy of the Python interpreter and a fresh set of libraries.

  • Activate the Virtual Environment: Once the virtual environment is created, you need to activate it.

    • On Windows:
      myenv\Scripts\activate
      
    • On macOS/Linux:
      source myenv/bin/activate
      

Install the Modlee Package

PyPI

Once you have Python installed and activated a virtual environment, you can install the Modlee package from PyPI. Run this command from the terminal/command line:

pip install modlee

Our package is built on top of PyTorch, PyTorch-lightning, MLFlow, and more to ensure you can continue developing ML with frameworks that you are familiar with.

Source

Alternatively, you can build the package from the source by cloning this repository and installing it from the pyproject.toml configuration file:

git clone https://github.com/modlee-ai/modlee
cd modlee
pip install .


Set API Key

Navigate to the dashboard and generate an API key. Either save your API key to an environment variable:

export MODLEE_API_KEY="my-api-key"

Or pass directly to the modlee.init function (less recommended):

# your_experiment_script.py
import modlee
modlee.init(api_key="my-api-key")


How to Use Modlee - Quick Example

Get started with Modlee by following these steps to set up and train a model using our recommender system. This guide will walk you through the process with a simple end-to-end example.

pip install modlee
import modlee
import lightning.pytorch as pl
import torch
import torchvision
from torch.utils.data import DataLoader
from torchvision import datasets, transforms

# Initialize Modlee with your API key
modlee.init(api_key="your-api-key")

transform = transforms.Compose([
    transforms.Grayscale(num_output_channels=1),
    transforms.ToTensor(),
    transforms.Normalize((0.5,), (0.5,))
])

# Load the Fashion MNIST dataset
train_dataset = datasets.FashionMNIST(root='./data', train=True, download=True, transform=transform)
test_dataset = datasets.FashionMNIST(root='./data', train=False, download=True, transform=transform)

# Create DataLoaders for training and testing
training_loader = DataLoader(train_dataset, batch_size=16, shuffle=True)
test_loader = DataLoader(test_dataset, batch_size=16, shuffle=False)

# Create a recommender for image classification tasks
recommender = modlee.recommender.ImageClassificationRecommender(
    num_classes=10
)

# Fit the recommender with the training DataLoader
recommender.fit(training_loader)

# Retrieve the recommended model from the recommender
modlee_model = recommender.model
print(f"\nRecommended model: \n{modlee_model}")

# Train the recommended model
with modlee.start_run() as run:
    trainer = pl.Trainer(max_epochs=1)
    trainer.fit(
        model=modlee_model,
        train_dataloaders=training_loader,
        val_dataloaders=test_loader
    )

You should see a recommended model as an output. If you are running into issues, please refer to our Troubleshooting Page for more help.


Supported Use Cases

At the moment we support modalities of images, tabular, time-series, and text, and tasks of classification and segmentation, with more coming soon. As with recommendation, use Discord to let us know which modalities and tasks you'd prefer or help make these changes on our GitHub.

Recommended Next Steps

To further develop your expertise, explore the following:

  1. Visit the Projects Page: Browse our projects page for guided examples and step-by-step instructions. These projects are designed to help you get hands-on experience with Modlee and apply it effectively.

  2. Dive into the Guides: Explore Modlee’s in-depth guides to discover advanced features and capabilities. These resources offer detailed instructions and practical examples to enhance your proficiency.

  3. Explore the Examples: Check out our collection of examples to see how Modlee is used across various tasks. These examples can spark ideas and show you how to implement Modlee in your projects.

  4. Join the Community: Participate in discussions and forums to connect with other users, seek advice, and share your experiences. Engaging with the community can provide additional support and insights.

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

modlee-0.0.4.tar.gz (69.2 kB view details)

Uploaded Source

Built Distribution

modlee-0.0.4-py3-none-any.whl (69.7 kB view details)

Uploaded Python 3

File details

Details for the file modlee-0.0.4.tar.gz.

File metadata

  • Download URL: modlee-0.0.4.tar.gz
  • Upload date:
  • Size: 69.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for modlee-0.0.4.tar.gz
Algorithm Hash digest
SHA256 8bcf08b5a575de50e7bb5d9277ecace9bd83eb2d0f74097329b58710f2bb0603
MD5 fb1fbd357460dffaebc223105ee2f5f9
BLAKE2b-256 75e8ee4c87a907eec471ad5dbca167dfa6191a1b949ba6cceae8d338d469495d

See more details on using hashes here.

File details

Details for the file modlee-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: modlee-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 69.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for modlee-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0a4fb91c85a3b8f92892b173bec0d18eaa71830d9bcbc50083cf3fe24c9e6610
MD5 dd6cd51ba10a8234685e6c37facc4699
BLAKE2b-256 d70bdbf59b990193ea16cd78fff599f2b4f8caec0899c22b99140a64bcaac0a7

See more details on using hashes here.

Supported by

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