Skip to content

missing 1 required positional argument: 'units' ann.py rnn #36

@EricBollar

Description

@EricBollar

Hi, I have been trying to set this up and I receive this error after running the script in the readme. Please let me know how to fix; I am not very familiar with python. Thanks!

File "main.py", line 16, in
rnn = RNN([1, 100, 100, 1]) # number of neurons in each layer
File "/usr/local/lib/python3.7/site-packages/bulbea-0.1.0-py3.7.egg/bulbea/learn/models/ann.py", line 29, in init
TypeError: init() missing 1 required positional argument: 'units'

The whole script:

import bulbea as bb
share = bb.Share('WIKI', 'GOOGL')
share.data

from bulbea.learn.evaluation import split
Xtrain, Xtest, ytrain, ytest = split(share, 'Close', normalize = True)

import numpy as np
Xtrain = np.reshape(Xtrain, (Xtrain.shape[0], Xtrain.shape[1], 1))
Xtest = np.reshape(Xtest, (Xtest.shape[0], Xtest.shape[1], 1))

from bulbea.learn.models import RNN
rnn = RNN([1, 100, 100, 1]) # number of neurons in each layer
rnn.fit(Xtrain, ytrain)

from sklearn.metrics import mean_squared_error
p = rnn.predict(Xtest)
mean_squared_error(ytest, p)

import matplotlib.pyplot as pplt
pplt.plot(ytest)
pplt.plot(p)
pplt.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions