Giter Club home page Giter Club logo

gpquant's People

Contributors

uepg-21 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  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  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  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gpquant's Issues

Seems gpquant not support multi-process .

Seems gpquant not support multi-process , cannot find parameters like 'n_jobs' in gplearn to control concurrency .
SymbolicRegressor logic running inside one process, and will be very slow if we use large dataset.

进化方式

你好大佬,请问代码中的轮盘赌的方式是否是每次随机选择,而没有对前一个子代的优质公式进行保留,用于变异进化

How to use backtester?

Do I understand correctly that if I want to use metrics such as annual return or shape ratio, I need to set the parameter 'transformer' to 'quantile'? I am then wondering about the method of specifying 'transformer_kwargs' in order to use that metric. And how do we set up the DataFrame (df) and signal for the backtester?"

Thank!

Orthogonal factors

Hello, may I please ask how to generate multiple orthogonal factors that tries to fit y with X? It seems that the current implementation only supports fitting one expression for one y, so some manual decomposition of Y is required. If you are too busy to implement, please share how would you try to tackle this. Here is my thought:

Implement another fitness eval function, that is sharpe - sum(correlation(prev_results))

Hope to hear from you soon, nice work!

Best regards,
JU PING

多个序列fit

请问如何fit多个股票序列呢,这个项目看起来只能fit一支股票,不知道有没有pandas groupby等trick能找到多个股票上同时fitness比较好的因子

no more Generation

传入数据后似乎没有迭代,并且好像调不到时序函数

微信图片_20231229111728

import SymbolicRegressor failed

In centos server (CentOS Linux release 7.9.2009) and python 3.8 environment, import SymbolicRegressor failed.
Error details like below:
[baikai@localhost gp]$ python3
Python 3.8.5 (default, Sep 4 2020, 07:30:14)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

from gpquant.SymbolicRegressor import SymbolicRegressor
Traceback (most recent call last):
File "", line 1, in
File "/home/baikai/.local/lib/python3.8/site-packages/gpquant/SymbolicRegressor.py", line 10, in
from .SyntaxTree import SyntaxTree
File "/home/baikai/.local/lib/python3.8/site-packages/gpquant/SyntaxTree.py", line 61, in
class SyntaxTree:
File "/home/baikai/.local/lib/python3.8/site-packages/gpquant/SyntaxTree.py", line 173, in SyntaxTree
def __flatten(self) -> list[Node]:
TypeError: 'type' object is not subscriptable

the problem of sharpe_ratio

微信图片_20240109105621 请问代码中调整的夏普指的是什么,这样做的目的是什么,直接将无风险收益率变小,使夏普比率为正来优化目标适合会更合理呢。感谢大佬回复!

较大数据规模下All-NaN slice问题

sr.fit(df.iloc[:508], df["C"].iloc[:508])

Traceback (most recent call last):
File "C:\Users\lpoem\PycharmProjects\factor_mining\main.py", line 44, in
sr.fit(df.iloc[:508], df["C"].iloc[:508])
File "C:\Users\lpoem\PycharmProjects\factor_mining.venv\Lib\site-packages\gpquant\SymbolicRegressor.py", line 144, in fit
self.__evolve()
File "C:\Users\lpoem\PycharmProjects\factor_mining.venv\Lib\site-packages\gpquant\SymbolicRegressor.py", line 106, in __evolve
parent = self.__tournament()
^^^^^^^^^^^^^^^^^^^
File "C:\Users\lpoem\PycharmProjects\factor_mining.venv\Lib\site-packages\gpquant\SymbolicRegressor.py", line 87, in __tournament
parent_index = contenders[np.nanargmax(fitness)]
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lpoem\PycharmProjects\factor_mining.venv\Lib\site-packages\numpy\lib\nanfunctions.py", line 613, in nanargmax
raise ValueError("All-NaN slice encountered")
ValueError: All-NaN slice encountered

def __tournament(self) -> SyntaxTree:
    contenders = random.sample(range(self.population_size), self.tournament_size)
    fitness = [self.fitness[i] for i in contenders]
    if self.metric.sign > 0:
        parent_index = contenders[np.nanargmax(fitness)]
    else:
        parent_index = contenders[np.nanargmin(fitness)]
    return self.trees[parent_index]

__tournament()函数似乎在较大数据规模下会出现fitness元素全为NaN的问题,不知道问题出在哪?可以请帮忙看一下是哪的问题?

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.