Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precision is ill-defined #44

Open
alphawolf1988 opened this issue Mar 24, 2024 · 1 comment
Open

Precision is ill-defined #44

alphawolf1988 opened this issue Mar 24, 2024 · 1 comment

Comments

@alphawolf1988
Copy link

alphawolf1988 commented Mar 24, 2024

Hello,

i'm currentlyx playing around with features and stumbling over the following message:

Train 'high_20_lc'. Algorithm lc. Label: high_20. Train length 525600. Train columns 9
C:\Users\Christian\miniconda3\envs\trading-bot\lib\site-packages\sklearn\metrics\_classification.py:1469: UndefinedMetricWarning: Precision is ill-defined and being set to 0.0 due to no predicted samples. Use `zero_division` parameter to control this behavior.
  _warn_prf(average, modifier, msg_start, len(result))
Train 'low_20_lc'. Algorithm lc. Label: low_20. Train length 525600. Train columns 9
C:\Users\Christian\miniconda3\envs\trading-bot\lib\site-packages\sklearn\metrics\_classification.py:1469: UndefinedMetricWarning: Precision is ill-defined and being set to 0.0 due to no predicted samples. Use `zero_division` parameter to control this behavior.
  _warn_prf(average, modifier, msg_start, len(result))

That error appears when i comment out the feature:

// {"column_prefix": "", "generator": "talib", "feature_prefix": "", "config": {"columns": ["close"], "functions": ["STDDEV"], "windows": [5, 10, 15, 60]}}

Part of my config is:

// === GENERATE FEATURES ===

    "feature_sets": [
        {"column_prefix": "", "generator": "talib", "feature_prefix": "", "config":  {"columns": ["close"], "functions": ["SMA"], "windows": [5, 8, 13]}},
        {"column_prefix": "", "generator": "talib", "feature_prefix": "", "config":  {"columns": ["close"], "functions": ["EMA"], "windows": [5, 10]}},
        {"column_prefix": "", "generator": "talib", "feature_prefix": "", "config":  {"columns": ["close"], "functions": ["LINEARREG_SLOPE"], "windows": [5, 10, 15, 60]}}
        // {"column_prefix": "", "generator": "talib", "feature_prefix": "", "config":  {"columns": ["close"], "functions": ["STDDEV"], "windows": [5, 10, 15, 60]}}
        // {"column_prefix": "", "generator": "common.my_feature_example:my_feature_example", "feature_prefix": "", "config":  {"columns": "close", "function": "add", "parameter": 2.0, "names": "close_add"}}
    ],

    // === LABELS ===

    "label_sets": [
        {"column_prefix": "", "generator": "highlow2", "feature_prefix": "", "config":  {"columns": ["close", "high", "low"], "function": "high", "thresholds": [2.0], "tolerance": 0.2, "horizon": 120, "names": ["high_20"]}},
        {"column_prefix": "", "generator": "highlow2", "feature_prefix": "", "config":  {"columns": ["close", "high", "low"], "function": "low", "thresholds": [2.0], "tolerance": 0.2, "horizon": 120, "names": ["low_20"]}}
    ],

    // === TRAIN ===

    "label_horizon": 120,  // Batch/offline: do not use these last rows because their labels might not be correct
    "train_length": 525600,  // Batch/offline: Uses this number of rows for training (if not additionally limited by the algorithm)

    "train_feature_sets": [
    {
        "generator": "train_features", "config": {
        // Use values from the attributes: train_features, labels, algorithms
    }}
    ],

    "train_features": [
        "close_SMA_5", "close_SMA_8", "close_SMA_13",
        "close_EMA_5", "close_EMA_10",
        "close_LINEARREG_SLOPE_5", "close_LINEARREG_SLOPE_10", "close_LINEARREG_SLOPE_15", "close_LINEARREG_SLOPE_60"
      //  "close_STDDEV_5", "close_STDDEV_10", "close_STDDEV_15", "close_STDDEV_60"
    ],

    "labels": ["high_20", "low_20"],

    "algorithms": [
        {
            "name": "lc",  // Unique name will be used as a column suffix
            "algo": "lc",  // Algorithm type is used to choose the train/predict function
            "params": {"penalty": "l2", "C": 1.0, "class_weight": null, "solver": "sag", "max_iter": 100},
            "train": {"is_scale": true, "length": 1000000, "shifts": []},
            "predict": {"length": 1440}
        }
    ],

Any idea what i'm doing wrong?

@PCC2901
Copy link

PCC2901 commented Oct 20, 2024

to fix your trouble check this click
maybe this will solve your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants