Comments (3)
Thanks a lot, tried this but still caught same error. Gonna play around to see if i can manage to get it it work but if you want to take a look, then here is my entire script.
When i convert the 'Date' column data with 'to_datetime' does it get converted to some sort of object?
The conversion works fine but i guess backtest.start is having problems looping threw the dates (trainStart, trainEnd ect) for some reason.
Can datetime have different formats, like the one your telling me to convert to '%Y-%m-%d
I also changed this to use the same format. Will i need to convert this also to datetime or does your module do this?
trainStart = '2015-11-01' # Start of training period
trainEnd = '2017-11-01' # End of training period
testStart = '2017-11-02' # Start of testing period
testEnd = '2017-11-17' # End of testing period
Here's the error.
Traceback (most recent call last):
File "clair2.py", line 36, in <module>
backtest.start(data, kernel='rbf', C=1, gamma=10)
File "/home/kodi/.local/lib/python3.5/site-packages/clairvoyant/engine.py", line 197, in start
Engine.start(self, data, **kwargs)
File "/home/kodi/.local/lib/python3.5/site-packages/clairvoyant/engine.py", line 50, in start
for i in range(self.trainStr, self.trainEnd+1):
TypeError: Can't convert 'int' object to str implicitly
from clairvoyant.
Getting your data ready is actually separate from the module. You can do it however you want. All you need to do is make sure your data column in your pandas dataframe is converted to datetime.
Looking at your CSV file, you want to do something like this
import pandas as pd
data = read_csv("file.csv")
data = data.round(3)
data['Date'] = pd.to_datetime(data.Date, format="%Y-%m-%d")
# 2015-01-02 = %Y-%m-%d
Also, what are the features you're using?
from clairvoyant.
Closing this, use a numerical index on your dataframe if you're still having issues.
from clairvoyant.
Related Issues (20)
- Bug in predict_proba? HOT 1
- Working example HOT 1
- ImportError: No module named 'backtester' HOT 7
- Dimensionality reduction with t-SNE
- IndexError: single positional indexer is out-of-bounds HOT 1
- IndexError: single positional indexer is out-of-bounds HOT 2
- SyntaxError: invalid syntax : "self.svc = SVC(**kwargs, probability=True)" HOT 4
- TypeError: a float is required: "self.svc.fit(self.scaler.transform(self.XX), self.yy)" HOT 5
- KeyError: 'EMA' HOT 1
- NameError: name 'backtester' is not defined HOT 7
- TypeError: 'str' object cannot be interpreted as an integer when running backtest.start() HOT 5
- data named 'SBUX.csv' HOT 1
- Code seems incorrect HOT 1
- Could you supply the file("SBUX.csv")? HOT 2
- Cannot Run Code HOT 4
- Error when running example: ufunc 'isfinite' not supported for the input types
- #HELP# Some errors appeared unusually HOT 1
- Project dependencies have API risk issues HOT 1
- Stock prediction tool
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clairvoyant.