In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /// script | |
| # requires-python = ">=3.11" | |
| # dependencies = [ | |
| # "cvxcla==2.7.1", | |
| # "numpy>=2", | |
| # ] | |
| # /// | |
| """A complete Critical Line Algorithm in 39 lines of NumPy, written with the KKT conditions. | |
| This is the listing of Figure 5 (Appendix C) of the cvxcla software paper, verbatim: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /// script | |
| # requires-python = ">=3.11" | |
| # dependencies = ["cvxcla>=2.3.4", "numpy"] | |
| # /// | |
| import time | |
| import numpy as np | |
| from cvxcla import CLA | |
| for n in (50, 500): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Long-Only Efficient Frontier Benchmark Challenge | |
| ================================================= | |
| "Shrinkage as Preconditioning: Matrix-Free Methods for | |
| Long-Only Portfolio Optimization" | |
| Generate the exact input data from the paper's efficient frontier experiment | |
| (Section 7, Figure 3) and benchmark your solver against the reference timings. | |
| Challenge: compute all 50 frontier portfolios faster than warm-started CG. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import numpy as np | |
| import cvxpy as cp | |
| from mosek.fusion import Model, Domain, Expr, ObjectiveSense | |
| def cvx_explicit(cov_factor, residual_var, F, mu, gamma, Lmax): | |
| n, m = F.shape |
http://www.oreilly.com/programming/free/files/microservices-for-java-developers.pdf
http://www.oreilly.com/programming/free/files/microservices-for-java-developers.epub
http://www.oreilly.com/programming/free/files/microservices-for-java-developers.mobi
http://www.oreilly.com/programming/free/files/modern-java-ee-design-patterns.pdf
http://www.oreilly.com/programming/free/files/modern-java-ee-design-patterns.epub
http://www.oreilly.com/programming/free/files/modern-java-ee-design-patterns.mobi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def f1(precision, recall): | |
| return 2*(precision*recall)/(precision+recall) | |
| if __name__ == '__main__': | |
| # Matrix for crypto finance | |
| TP = 70 # on how many days did you correctly predict the market goes up? | |
| FP = 10 # on how many days did you predict the market goes up, but it actually went down? | |
| FN = 8 # on how many days did you predict the market goes down, but it actually went up? | |
| TN = 12 # on how many days did you correctly predict the market goes down? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM rocker/rstudio:3.6.1 | |
| # see https://arrow.apache.org/install/ | |
| # rocker/rstudio is based on debian | |
| RUN apt update && \ | |
| apt install -y -V apt-transport-https curl gnupg lsb-release apt-utils | |
| RUN echo "deb http://deb.debian.org/debian $(lsb_release --codename --short)-backports main contrib" >> /etc/apt/sources.list.d/backports.list && \ | |
| curl --output /usr/share/keyrings/apache-arrow-keyring.gpg https://dl.bintray.com/apache/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-keyring.gpg && \ | |
| echo "deb [arch=amd64 signed-by=/usr/share/keyrings/apache-arrow-keyring.gpg] https://dl.bintray.com/apache/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/ $(lsb_release --codename --short) main" >> /etc/apt/sources.list.d/apache-arrow.list && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import os | |
| import nbformat as nbf | |
| from config.config import logger | |
| from pyutil.parent import Production | |
| from pyutil.sql.interfaces.symbols.strategy import Strategy | |
| from pyutil.sql.session import session | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # We create a standard logger with two handlers | |
| # One of them is using io.StringIO for streaming | |
| # Subsequently we add the value() method to the logger, e.g. it will be possible to call | |
| # logger.value() and get the entire history of all messages sent to the logger. | |
| # | |
| # I have never managed to get my head around logging in Python. Any comments are very appreciated. | |
| import logging | |
| import types |
NewerOlder