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: README.md
+1
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,7 @@ Dataset | Title
30
30
make_blobs | Generate isotropic Gaussian blobs for clustering. | [link](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_moons.html)
31
31
make_moons | Make two interleaving half circles | [link](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_blobs.html)
32
32
make_s_curve | Generate an S curve dataset. | [link](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_s_curve.html)
33
+
make_regression | Generate a random regression problem. | [link](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_regression.html])
33
34
34
35
**Disclaimer**: SyntheticDatasets.jl borrows code and documentation from
35
36
[scikit-learn](https://scikit-learn.org/stable/modules/classes.html#samples-generator) in the dataset module, but *it is not an official part
Copy file name to clipboardExpand all lines: src/sklearn.jl
+57
Original file line number
Diff line number
Diff line change
@@ -83,4 +83,61 @@ function generate_s_curve(; n_samples::Int = 100,
83
83
random_state = random_state)
84
84
85
85
returnconvert(features, labels)
86
+
end
87
+
88
+
"""
89
+
generate_regression(; n_samples::Int = 100,
90
+
n_features::Int = 100,
91
+
n_informative::Int = 10,
92
+
n_targets::Int = 1,
93
+
bias::Float64 = 0.0,
94
+
effective_rank::Union{Int, Nothing} = nothing,
95
+
tail_strength::Float64 = 0.5,
96
+
noise::Float64 = 0.0,
97
+
shuffle::Bool = true,
98
+
coef::Bool = false,
99
+
random_state::Union{Int, Nothing}= nothing)
100
+
Generate a random regression problem. Sklearn interface to make_regression.
101
+
# Arguments
102
+
- `n_samples::Int = 100`: The number of samples.
103
+
- `n_features::Int = 2`: The number of features.
104
+
- `n_informative::Int = 10`: The number of informative features, i.e., the number of features used to build the linear model used to generate the output.
105
+
- `n_targets::Int = 1`: The number of regression targets, i.e., the dimension of the y output vector associated with a sample. By default, the output is a scalar.
106
+
- `bias::Float = 0.0`: The bias term in the underlying linear model.
107
+
- `effective_rank::Union{Int, Nothing} = nothing`: If not `nothing`, the approximate number of singular vectors required to explain most of the input data by linear combinations. Using this kind of singular spectrum in the input allows the generator to reproduce the correlations often observed in practice. If `nothing`, the input set is well conditioned, centered and gaussian with unit variance.
108
+
- `tail_strength::Float = 0.5`: The relative importance of the fat noisy tail of the singular values profile if effective_rank is not None.
109
+
- `noise::Union{Nothing, Float64} = nothing`: Standard deviation of Gaussian noise added to the data.
110
+
- `shuffle::Bool = true`: Shuffle the samples and the features.
111
+
- `coef::Bool = false`: If `true`, the coefficients of the underlying linear model are returned.
112
+
- `random_state::Union{Int, Nothing} = nothing`: Determines random number generation for dataset shuffling and noise.
0 commit comments