PyTA | Python library for performing computed technical analysis | Business library
kandi X-RAY | PyTA Summary
kandi X-RAY | PyTA Summary
Python library for performing computed technical analysis on stock data statistics. Inspired by TA-Lib.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Calculate the ratio of prices .
- Emulate Ewma .
- Stack x y onto y
- Calculate a rolling mean .
- Calculate the MACD line .
- Calculate MACD histogram .
- Bollinger upper case .
- Bollinger lower case .
- Calculate the MACD of a market signal .
PyTA Key Features
PyTA Examples and Code Snippets
Community Discussions
Trending Discussions on PyTA
QUESTION
You are given 3 well known Polish Books and based on some fragment of text you have to decide whether it's the first one, second or third. Your points are measured by some formula and to achieve 100 points you need to get accuracy greater than 90%.
My solution to solve this problem was to map the most common words and based on that answer, for that solution I've got 70 points but still, I don't know how to approach this problem. Your code may be in Python or C++, you are given 3 books and program to test your solution Inputs are separated with different lengths based on sentences or some amount of words. You are also sure you will not get half-word. Problem statement (only in Polish currently). You can also submit your code there. How can I approach this problem differentlt to get 100 points, are there some Data Sciece algorithms which will help me with that problem.
...ANSWER
Answered 2020-Jan-25 at 18:20For non-polish readers: you are given those books only when preparing your solution, you won't have access to them during test. If you try to bundle them with binary somehow those would exceed 10kb
limit hence you need to compress information somehow.
I would go for Naive Bayes
classifier by default for a simple solution .
Due to time constraint I would go a little bit different route though.
Data preparationRead all files in and tokenize them. Would be easiest with Python's split
functionality (and whole program would be easiest, time constraint probably won't be a problem). Split on whitespace and punctuation as those are mostly noise and are not representative of texts.
Now calculate how often each of the tokens (words) occurs in each text, e.g. dog
occured 15
times in first text and 3
times in another. Save those in three separate dictionaries, if the size of dict
exceeds 10kb
remove words occurring least frequently and adjust accordingly.
Use 3 unsigned long
variables to keep results for each texts to keep overflow in check (it should be enough).
For every input text split it just like above.
For every word check in dictionaries how often those occured for each text and add this to one of 3
result variables. If it doesn't exist just add 0
.
Finally return text which gathered "most points" this way. This should get quite a good score.
Better solutionNaive Bayes with probabilities would work much better but given competition constraints I don't think it is a viable solution.
To do it, you would have to calculate probability of each word for each text and use log
operstions during summation to avoid aforementioned overflow, just throwing it out for you to consider, doable but probably overkill.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PyTA
You can use PyTA like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page