Skip to content

Class: InferRules

Optimizer that infers natural-language rules from training data (dspy.InferRules).

URI: dspy:InferRules

 classDiagram
    class InferRules
    click InferRules href "../InferRules/"
      BootstrapFewShot <|-- InferRules
        click BootstrapFewShot href "../BootstrapFewShot/"

      InferRules : description

      InferRules : id

      InferRules : max_bootstrapped_demos

      InferRules : max_errors

      InferRules : max_labeled_demos

      InferRules : max_rounds

      InferRules : metric

      InferRules : metric_threshold

      InferRules : name

      InferRules : num_rules

      InferRules : teacher_settings





        InferRules --> "0..1" Any : teacher_settings
        click Any href "../Any/"



Inheritance

Slots

Name Cardinality and Range Description Inheritance
num_rules 0..1
Integer
direct
metric_threshold 0..1
Float
BootstrapFewShot
teacher_settings 0..1
Any
BootstrapFewShot
max_bootstrapped_demos 0..1
Integer
BootstrapFewShot
max_labeled_demos 0..1
Integer
BootstrapFewShot
max_rounds 0..1
Integer
BootstrapFewShot
max_errors 0..1
Integer
BootstrapFewShot
metric 0..1
String
Dotted import path of the metric callable (or its name) Teleprompter
id 1
Identifier
Stable opaque identifier for an instance NamedThing
name 0..1
String
Short human-readable name NamedThing
description 0..1
String
Free-form description NamedThing

In Subsets

Identifier and Mapping Information

Annotations

property value
dspy_source_paths ['dspy/teleprompt/infer_rules.py']
dspy_source_urls ['https://github.com/stanfordnlp/dspy/blob/main/dspy/teleprompt/infer_rules.py']

Schema Source

Mappings

Mapping Type Mapped Value
self dspy:InferRules
native dspy:InferRules

LinkML Source

Direct

name: InferRules
annotations:
  dspy_source_paths:
    tag: dspy_source_paths
    value:
    - dspy/teleprompt/infer_rules.py
  dspy_source_urls:
    tag: dspy_source_urls
    value:
    - https://github.com/stanfordnlp/dspy/blob/main/dspy/teleprompt/infer_rules.py
description: Optimizer that infers natural-language rules from training data (``dspy.InferRules``).
in_subset:
- teleprompt
from_schema: https://w3id.org/lmodel/dspy
is_a: BootstrapFewShot
attributes:
  num_rules:
    name: num_rules
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    domain_of:
    - InferRules
    range: integer
    minimum_value: 1

Induced

name: InferRules
annotations:
  dspy_source_paths:
    tag: dspy_source_paths
    value:
    - dspy/teleprompt/infer_rules.py
  dspy_source_urls:
    tag: dspy_source_urls
    value:
    - https://github.com/stanfordnlp/dspy/blob/main/dspy/teleprompt/infer_rules.py
description: Optimizer that infers natural-language rules from training data (``dspy.InferRules``).
in_subset:
- teleprompt
from_schema: https://w3id.org/lmodel/dspy
is_a: BootstrapFewShot
attributes:
  num_rules:
    name: num_rules
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: InferRules
    domain_of:
    - InferRules
    range: integer
    minimum_value: 1
  metric_threshold:
    name: metric_threshold
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: InferRules
    domain_of:
    - BestOfN
    - Refine
    - BootstrapFewShot
    - COPRO
    - MIPROv2
    range: float
  teacher_settings:
    name: teacher_settings
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: InferRules
    domain_of:
    - BootstrapFewShot
    - MIPROv2
    - BootstrapFinetune
    range: Any
  max_bootstrapped_demos:
    name: max_bootstrapped_demos
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    ifabsent: int(4)
    owner: InferRules
    domain_of:
    - BootstrapFewShot
    - MIPROv2
    - SIMBA
    - GEPA
    range: integer
    minimum_value: 0
  max_labeled_demos:
    name: max_labeled_demos
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    ifabsent: int(16)
    owner: InferRules
    domain_of:
    - LabeledFewShot
    - BootstrapFewShot
    - MIPROv2
    - SIMBA
    - GEPA
    range: integer
    minimum_value: 0
  max_rounds:
    name: max_rounds
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    ifabsent: int(1)
    owner: InferRules
    domain_of:
    - BootstrapFewShot
    range: integer
    minimum_value: 1
  max_errors:
    name: max_errors
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: InferRules
    domain_of:
    - Parallel
    - BootstrapFewShot
    - Evaluate
    - Settings
    range: integer
    minimum_value: 0
  metric:
    name: metric
    description: Dotted import path of the metric callable (or its name).
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: InferRules
    domain_of:
    - Teleprompter
    - Evaluate
    range: string
  id:
    name: id
    description: Stable opaque identifier for an instance.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    slot_uri: schema:identifier
    identifier: true
    owner: InferRules
    domain_of:
    - NamedThing
    range: Identifier
    required: true
  name:
    name: name
    description: Short human-readable name.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    slot_uri: rdfs:label
    owner: InferRules
    domain_of:
    - NamedThing
    - LMToolCallPart
    - LMMessage
    - LMToolSpec
    range: string
  description:
    name: description
    description: Free-form description.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    slot_uri: dct:description
    owner: InferRules
    domain_of:
    - NamedThing
    - LMToolSpec
    range: string