Skip to content

Commit 7304fda

Browse files
docs
1 parent 834c367 commit 7304fda

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

docs/src/index.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,26 +140,23 @@ In practice, applying `getobs` and `numobs` on datasets is equivalent to applyin
140140

141141
## Conditional module loading
142142

143-
MLDatasets.jl relies on many different packages in order to load and process the diverse type of
144-
datasets it supports. Most likely, any single user of the library will use a limited subset
145-
of these functionalities. In order to reduce the time taken by `using MLDatasets` in users' code,
143+
MLDatasets.jl relies on many different packages in order to load and process the diverse type of datasets it supports. Most likely, any single user of the library will use a limited subset of these functionalities.
144+
In order to reduce the time taken by `using MLDatasets` in users' code,
146145
we use a [lazy import system](https://github.com/johnnychen94/LazyModules.jl) that defers the import of packages inside MLDatasets.jl as much as possible.
147-
For some of the packages like (e.g. `DataFrames.jl`) some manual intervention is needed from the user.
146+
For some of the packages, some manual intervention is needed from the user.
148147
As an example, the following code will produce an error:
149-
```julia-repl
150-
julia> using MLDataset
151148

152-
julia> MNIST(); # fine, MNIST doesn't requ
153-
```
154149
```julia-repl
155150
julia> using MLDataset
156151
157152
julia> MNIST(); # fine, MNIST doesn't require DataFrames
158153
159154
julia> Iris() # ERROR: Add `import DataFrames` or `using DataFrames` to your code to unlock this functionality.
160155
```
161-
As recommended by the error message we can easily fix the error with an additional import:
162-
```
156+
157+
We can easily fix the error with an additional import as recommended by the error message:
158+
159+
```julia-repl
163160
julia> using MLDataset, DataFrames
164161
165162
julia> Iris()

0 commit comments

Comments
 (0)