GithubHelp home page GithubHelp logo

boladjivinny / olpy Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 2.0 887 KB

A Python Library for Online Machine Learning Algorithms

Home Page: https://olpy.readthedocs.io/en/latest/

License: MIT License

Python 0.59% Turing 99.41%
classification machine-learning machine-learning-algorithms online-learning

olpy's People

Contributors

boladjivinny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

olpy's Issues

Partial fit in CW raising array dimensions errors

While using the partial_fit method in the CW, the _update method raises an error while computing the covariance matrix.

Steps to reproduce

  • Load a dataset
  • Initializes a CW model
  • Do a partial_fit using one data point

Traceback (most recent call last):
File "script.py", line 88, in
model = model.partial_fit(x, y, classes=[1, -1])
File "/home/boladji/project/pyenv/lib/python3.8/site-packages/olpy_boladjivinny-1.0.0-py3.8.egg/olpy/classifiers/__base.py", line 124, in partial_fit
self._update(x, y)
File "/home/boladji/project/pyenv/lib/python3.8/site-packages/olpy_boladjivinny-1.0.0-py3.8.egg/olpy/classifiers/cw.py", line 79, in _update
v_t = x @ np.diag(np.diag(self._sigma)) @ x.T
ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 1 is different from 123)

Add type hinting for functions

Vinny, this is really really awesome! I love your compliance with PEP-8 standards, use of poetry, code elegance, and neat documentation. I'll make some time this week to try it out to train some models for online learning!

Looking through the code, I realized that this package could take advantage of type hints just to make readability, understanding of the expected outputs, code linting and IDE integration even more easier.

As an example, the class olpy.preprocessing.labels.LabelEncoder has a fit(self, y) method. Adding type hints will yield:

import numpy as np

class LabelEncoder 
    
    def fit(self, y:np.ndarray) -> LabelEncoder:
        # method code goes here
        return self

Hope this helps! Would probably submit a few PRs to help with this after trying out the package. Cheers!

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.