Skip to main content

Sklearn like library supporting numerous Activity of Daily Livings datasets

Project description

Activities of Daily Living - Machine Learning

Contains data preprocessing and visualization methods for ADL datasets.

PyPI version Download Stats License

Activities of Daily living (ADLs) e.g cooking, working, sleeping and devices readings are recorded by smart home inhabitants. The goal is to predict inhabitants activities using device readings. Pyadlml offers an easy way to fetch, visualize and preprocess common datasets. My further goal is to replicate prominent work in this domain.

Last Stable Release

$ pip install pyadlml

Latest Development Changes

$ git clone https://github.com/tcsvn/pyadlml
$ cd pyadlml

Usage example

From a jupyter notebook run

from pyadlml.dataset import fetch_amsterdam

# Fetch dataset
data = fetch_amsterdam(cache=True)

# plot the persons activity density distribution over one day
from pyadlml.dataset.plot.activities import ridge_line
ridge_line(data.df_activities)

# plot the signal cross correlation between devices
from pyadlml.dataset.plot.devices import heatmap_cross_correlation
heatmap_cross_correlation(data.df_devices)

# create a raw representation with 20 second timeslices
from pyadlml.preprocessing import DiscreteEncoder, LabelEncoder
enc_dat = DiscreteEncoder(rep='raw', t_res='20s')
raw = enc_dat.fit_transform(data.df_devices)

# label the datapoints with the corresponding activity
lbls = LabelEncoder(raw).fit_transform(data.df_activities)

X = raw.values
y = lbls.values

# from here on do all the other fancy machine learning stuff you already know
from sklearn import svm
clf = svm.SVC()
clf.fit(X, y)
...

For more examples and and how to use, please refer to the Documentation (to come) or the Notebooks

Features

  • 8 Datasets
  • A bunch of plots visualizing devices, activities and their interaction
  • Different data representations
    • Discrete timeseries
      • raw
      • changepoint
      • lastfired
    • Timeseries as images
  • Methods for importing data from Home Assistant/Activity Assistant

Supported Datasets

  • Amsterdam [1]
  • Aras [2]
  • Casas Aruba (2011) [3]
  • Casas Milan (2009) [4]
  • Kasteren House A,B,C [5]
  • MitLab [6]
  • Tuebingen 2019 [7]
  • UCI Adl Binary [8]

Models

Iid data

  • SVM
  • Winnow algorithm
  • Naive bayes
  • Decision Trees

Sequential discretized

  • RNNs
  • LSTMs
  • HMMs
  • HSMMs
  • TCNs

Images

  • CNN
  • Transformer

Temporal points

  • TPPs

Replication list

Here are papers I plan to replicate

Contributing

  1. Fork it (https://github.com/tcsvn/pyadlml/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Related projects

Support

  • Todo buy me a coffee batch

Sources

  • Datasets (TODO get all correct citations)
    [1]: https://sites.google.com/site/tim0306/
    [2]: H. Alemdar, H. Ertan, O.D. Incel, C. Ersoy, ARAS Human Activity Datasets in Multiple Homes with Multiple Residents, Pervasive Health, Venice, May 2013.
    [3]: WSU CASAS smart home project: D. Cook. Learning setting-generalized activity models for smart spaces. IEEE Intelligent Systems, 2011.
    [4]: WSU CASAS smart home project: D. Cook. Learning setting-generalized activity models for smart spaces. IEEE Intelligent Systems, 2011.
    [5]:
    [6]:
    [7]: Me :)
    [8]: Ordonez, F.J.; de Toledo, P.; Sanchis, A. Activity Recognition Using Hybrid Generative/Discriminative Models on Home Environments Using Binary Sensors. Sensors 2013, 13, 5460-5477.
  • TODO cite every algorithm package

License

MIT © tcsvn

sdf

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

pyadlml-0.0.5.5a0.tar.gz (89.5 kB view details)

Uploaded Source

Built Distribution

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

pyadlml-0.0.5.5a0-py3-none-any.whl (140.1 kB view details)

Uploaded Python 3

File details

Details for the file pyadlml-0.0.5.5a0.tar.gz.

File metadata

  • Download URL: pyadlml-0.0.5.5a0.tar.gz
  • Upload date:
  • Size: 89.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.6

File hashes

Hashes for pyadlml-0.0.5.5a0.tar.gz
Algorithm Hash digest
SHA256 ee2f21a8bb5af7d20b44e5c9db9aa0e4454ab4a61ee4cb0f2ca9da061a5db451
MD5 b291bd643ade2995268130816cd80ba0
BLAKE2b-256 d2b525a195009481a63c1b4c2bfee98550a4aed8a7f3ac02b456914fd8d6b2af

See more details on using hashes here.

File details

Details for the file pyadlml-0.0.5.5a0-py3-none-any.whl.

File metadata

  • Download URL: pyadlml-0.0.5.5a0-py3-none-any.whl
  • Upload date:
  • Size: 140.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.6

File hashes

Hashes for pyadlml-0.0.5.5a0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee93beaebaef5e99b4a94e67e619bd1c9ba92f42b7fb3597e92293c99ecdaa05
MD5 3d273a06ef5a26f665a5973c863708b6
BLAKE2b-256 47ecca34fb8e436c12595e024a44f765e11981c2dd08b9a15bee96019b3dcca4

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