Skip to content

Commit

Permalink
minor format fixes in cls2
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorcampbell committed Dec 28, 2023
1 parent f9e3044 commit 0b11a19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/classification2.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,20 +395,20 @@ the `random_state` argument that is available in many `pandas` and `scikit-learn
functions. Those functions will then use your `Generator` to generate random numbers instead of
`numpy`'s default generator. For example, we can reproduce our earlier example by using a `Generator`
object with the `seed` value set to 1; we get the same lists of numbers once again.
```{code}
```python
from numpy.random import Generator, PCG64
rng = Generator(PCG64(seed=1))
random_numbers1_third = nums_0_to_9.sample(n=10, random_state=rng).to_list()
random_numbers1_third
```
```{code}
```text
array([2, 9, 6, 4, 0, 3, 1, 7, 8, 5])
```
```{code}
```python
random_numbers2_third = nums_0_to_9.sample(n=10, random_state=rng).to_list()
random_numbers2_third
```
```{code}
```text
array([9, 5, 3, 0, 8, 4, 2, 1, 6, 7])
```
Expand Down

0 comments on commit 0b11a19

Please sign in to comment.