Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kjappelbaum committed Aug 12, 2024
1 parent e506957 commit 918babc
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion docs/api/sampler.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,35 @@ sampler = TemplateSampler(df: pd.DataFrame, meta: Dict, config: Dict, column_dat

#### Main Methods

(... other methods remain the same ...)
##### `sample`

```python
def sample(self, sample: Optional[pd.Series], template: str) -> str
```

Generates a text sample based on a template and a data sample.

- `sample`: A row from the dataset. If None, a random sample is chosen.
- `template`: The template string to be filled.
- Returns: The completed text sample with all variables replaced by their values.

##### `enable_class_balancing`

```python
def enable_class_balancing(self, column: str)
```

Enables class-balanced sampling for a specified column.

- `column`: The column to use for balancing.

##### `disable_class_balancing`

```python
def disable_class_balancing(self)
```

Disables class-balanced sampling and reverts to the original dataset.

#### Identifier Wrapping

Expand Down

0 comments on commit 918babc

Please sign in to comment.