Git Product home page Git Product logo

everywhereml's Introduction

EloquentArduino library

This library contains source code and examples from the eloquentarduino blog, covering very different topics:

  • data structures
  • image / camera processing
  • print utilities
  • ...other miscellaneous

You can install this library either by cloning the repo or directly from the Arduino IDE Library Manager.

If you're interested in TinyML, I suggest you check out the EloquentTinyML library.

everywhereml's People

Contributors

eloquentarduino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

everywhereml's Issues

Cant get it to work with custom dataset (Timeseries)

I've been trying to implement my own dataset, but keep running into issues when using everwhereml.
I've implemented a decision tree approach using normal SKLearn and works fine.

Example using Standard Sklearn

data=pd.read_csv(config.get('Datasets', 'Minime'), delimiter=',')

# use Decision tree to classify Minime  if it is good or bad
#drop first row
data = data[['Time', 'Flag']]
data['Time'] = data['Time'].str.replace(':', '')
data['Time'] = data['Time'].str.replace('.', '')

X = data.drop('Flag', axis=1)
y = data['Flag']

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20)
classifier = DecisionTreeClassifier()
classifier.fit(X_train, y_train)


Example using everywhereml SKlearn

data=pd.read_csv(config.get('Datasets', 'Minime'), delimiter=',')

data = data[['Time', 'Flag']]
data['Time'] = data['Time'].str.replace(':', '')
data['Time'] = data['Time'].str.replace('.', '')
X = data.drop('Flag', axis=1)
y = data['Flag']
#X, y = make_blobs(n_samples=100, centers=3, n_features=2, random_state=0)

clf = DecisionTreeClassifier()

clf.fit(X, y)

Gives out this error in python3.9

Traceback (most recent call last):
  File "/home/vasilisieropoulos/gitstuff/IoT-Ai/Machine Learning/thefinish.py", line 32, in <module>
    clf.fit(X, y)
  File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/everywhereml/sklearn/SklearnBaseClassifier.py", line 95, in fit
    self.dataset = Dataset.from_XY(X, y)
  File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/everywhereml/data/Dataset.py", line 39, in from_XY
    return Dataset(
  File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/everywhereml/data/Dataset.py", line 124, in __init__
    self.replace(X=X, y=y, feature_names=feature_names, target_names=target_names)
  File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/everywhereml/data/Dataset.py", line 195, in replace
    self._update_df()
  File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/everywhereml/data/Dataset.py", line 285, in _update_df
    data = np.hstack((self.X, self.y.reshape((-1, 1))))
  File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/pandas/core/generic.py", line 5575, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'reshape'

Is this due to the python version or something else ? I can't get this to work in python3.10 since the Iterable abstract class was removed from collections in Python 3.10.

SerialCollector: `np.int` was deprecated

everywhereml/data/collect/SerialCollector.py, line 104:

AttributeError: module 'numpy' has no attribute 'int'.

np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'?

I suggest replacing

y=np.asarray(y, dtype=np.int),

with

y=np.asarray(y, dtype=int),

'WindowsPath' object is not iterable

print(pipeline.to_arduino_file(filename='path-to-sketch/HogPipeline.h',instance_name='hog'
))
Traceback (most recent call last):

File "", line 1, in
print(pipeline.to_arduino_file(filename='path-to-sketch/HogPipeline.h',instance_name='hog'

File "E:\anaconda3\lib\site-packages\everywhereml\code_generators\GeneratesCode.py", line 83, in to_arduino_file
return self.to_file(filename, self.to_arduino(**kwargs))

File "E:\anaconda3\lib\site-packages\everywhereml\code_generators\GeneratesCode.py", line 74, in to_arduino
return self.to_cpp(dialect='arduino', **kwargs)

File "E:\anaconda3\lib\site-packages\everywhereml\code_generators\GeneratesCode.py", line 51, in to_cpp
return self.to_language(

File "E:\anaconda3\lib\site-packages\everywhereml\code_generators\GeneratesCode.py", line 156, in to_language
jinja = Jinja(self.template_folder, language=language, dialect=dialect)

File "E:\anaconda3\lib\site-packages\everywhereml\code_generators\jinja\Jinja.py", line 19, in init
self.loader = FileSystemLoader(base_folder, language=language, dialect=dialect)

File "E:\anaconda3\lib\site-packages\everywhereml\code_generators\jinja\FileSystemLoader.py", line 19, in init
super(FileSystemLoader, self).init(base_folder, **kwargs)

File "E:\anaconda3\lib\site-packages\jinja2\loaders.py", line 163, in init
self.searchpath = list(searchpath)

TypeError: 'WindowsPath' object is not iterable

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.