Skip to content

Instantly share code, notes, and snippets.

View omegaml's full-sized avatar
💭
MLOps simplified.

omega-ml omegaml

💭
MLOps simplified.
View GitHub Profile
@omegaml
omegaml / example_mnist_js.md
Last active April 24, 2020 18:57 — forked from miraculixx/index.html
MNIST example HTML front-end to omega|ml, using the REST API

MNIST Digits Recognition using Machine Learning This is a live implementation of the MNIST digits recognition problem using a model trained & deployed by omega|ml

The model is adopted from this scikit-learn example (https://scikit-learn.org/stable/auto_examples/classification/plot_digits_classification.html) The model has been trained with and deployed by omega|ml with just one line of code.

How to use:

  1. in Jupyter NB copy/paste/run the code from the scikit learn example https://scikit-learn.org/stable/auto_examples/classification/plot_digits_classification.html
@omegaml
omegaml / omegaml_dataset.py
Last active March 25, 2020 22:17
omega|ml streaming minibatch examples
# Using an omegaml dataset as a source and sink
#
# * No need to have a MQTT or Kafka broker
# * Use the omegaml REST API for both input and output to support any client
from minibatch.contrib.omegaml import DatasetSource, DatasetSink
import minibatch as mb
# cleanup (not strictly required, i.e. can be kept ongoing)
om.datasets.drop('stream-sink', force=True)
om.datasets.drop('stream-sample', force=True)
@omegaml
omegaml / README.md
Created January 29, 2020 09:21
How to develop and deploy omega|ml plugins

How to develop an omega|ml plugin

omega|ml plugins come in two forms:

  • Mixins - extend the functionality of an existing component, e.g. om.datasets, om.modelsor om.runtime
  • Backends - add new capabilities to store and process a certain type of model (framework) or data object

If you want to add support for a new machine learning framework that omega|ml does not support yet, implement a backend. If you want to add pre- and post-processing to some method already provided by omega|ml, implement a mixin.

@omegaml
omegaml / omx_iotools.py
Last active November 12, 2019 22:54
read and write arbitrary large csv
"""
omegaml write and read large CSV files from/to remote or local file paths
Supports s3, hdfs, http/s, sftp, scp, ssh
This is sample code for and provided for convenience. Adopt to your specific
requirement as needed.
Installation:
!pip install -q getgist
!rm -f *omx_iotools.py && getgist -y omegaml omx_iotools.py
@omegaml
omegaml / mdataframe-summary.ipynb
Created November 9, 2019 17:56
MDataFrame - a short summary
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@omegaml
omegaml / omx_transform.py
Last active November 9, 2019 17:58
omega|ml parallel data transformation & processing plugin for large-scale out of core data
# version of this plugin
version = '0.1.1'
"""
Pre-release of omegaml parallel processing for MDataFrame
Usage:
def myproc(df):
# do something with df, a in-memory Pandas DataFrame
# return None to store the updated df, return a DataFrame or Series
@omegaml
omegaml / omx_snowflake.py
Last active April 2, 2020 12:57
omega|ml snowflake datasets plugin
from omegaml.backends.basedata import BaseDataBackend
from base64 import b64encode, b64decode
from sqlalchemy import create_engine
import pandas as pd
# version of this plugin
version = '0.1.3'
class SnowflakeDataBackend(BaseDataBackend):
@omegaml
omegaml / tfkeras-tutorial.ipynb
Created August 23, 2019 12:53
omega|ml tensorflow keras tutorial
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@omegaml
omegaml / tfestimator-tutorial.ipynb
Last active August 23, 2019 12:54
omega|ml tensorflow estimator tutorial
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@omegaml
omegaml / truefalse
Created April 30, 2019 08:30
a simple true false check that works on string and numeric inputs
istrue = lambda v: (
(v.lower() in ('yes', '1', 'y', 'true', 't'))
if isinstance(v, str) else bool(v)
)
isfalse = lambda v: not istrue(v)