You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/sklearn.jl
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -240,6 +240,35 @@ function generate_classification(; n_samples::Int = 100,
240
240
returnconvert(features, labels)
241
241
end
242
242
243
+
"""
244
+
function generate_low_rank_matrix(; n_samples::Int =100,
245
+
n_features::Int =100,
246
+
effective_rank::Int =10,
247
+
tail_strength::Float64 =0.5,
248
+
random_state::Union{Int, Nothing} = nothing)
249
+
Generate a mostly low rank matrix with bell-shaped singular values
250
+
#Arguments
251
+
- `n_samples::Int = 100`: The number of samples.
252
+
- `n_features::Int = 20`: The total number of features. These comprise `n_informative` informative features, `n_redundant` redundant features, `n_repeated` duplicated features and `n_features-n_informative-n_redundant-n_repeated` useless features drawn at random.
253
+
- `effective_rank::Int = 10`: The approximate number of singular vectors required to explain most of the data by linear combinations.
254
+
- `tail_strength::Float64 = 0.5`: The relative importance of the fat noisy tail of the singular values profile.
255
+
- `random_state::Union{Int, Nothing} = nothing`: Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary.
0 commit comments