Skip to content

Error while Trading Model example running #40

@snussik

Description

@snussik

Describe the bug
While running the tutorial getting the error:

Traceback (most recent call last):
  File "/Users/snusik_zzz/GIT/ap/venv/bin/mflow", line 8, in <module>
    sys.exit(main())
  File "/Users/snusik_zzz/GIT/ap/venv/lib/python3.8/site-packages/alphapy/market_flow.py", line 435, in main
    model = market_pipeline(model, market_specs)
  File "/Users/snusik_zzz/GIT/ap/venv/lib/python3.8/site-packages/alphapy/market_flow.py", line 302, in market_pipeline
    run_analysis(a, lag_period, forecast_period, leaders, predict_history)
  File "/Users/snusik_zzz/GIT/ap/venv/lib/python3.8/site-packages/alphapy/analysis.py", line 270, in run_analysis
    analysis.model = main_pipeline(model)
  File "/Users/snusik_zzz/GIT/ap/venv/lib/python3.8/site-packages/alphapy/__main__.py", line 436, in main_pipeline
    model = training_pipeline(model)
  File "/Users/snusik_zzz/GIT/ap/venv/lib/python3.8/site-packages/alphapy/__main__.py", line 230, in training_pipeline
    model = sample_data(model)
  File "/Users/snusik_zzz/GIT/ap/venv/lib/python3.8/site-packages/alphapy/data.py", line 280, in sample_data
    X, y = sampler.fit_sample(X_train, y_train)
AttributeError: 'RandomUnderSampler' object has no attribute 'fit_sample'

Desktop:

  • OS: macOS 10.15.2

I think it should be X, y = sampler.fit_resample(X_train, y_train) in the data.py file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions