Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -146,7 +146,7 @@ def generate_xor(n_samples=400): # Reduced from 800 for performance
|
|
| 146 |
y = np.logical_xor(X[:, 0] > 0, X[:, 1] > 0).astype(int)
|
| 147 |
return X, y
|
| 148 |
|
| 149 |
-
def generate_sine_wave(n_samples=400
|
| 150 |
X = np.linspace(-3, 3, n_samples).reshape(-1, 1)
|
| 151 |
y = np.sin(X) + np.random.normal(0, noise / 100, X.shape)
|
| 152 |
return np.hstack([X, X**2]), y.ravel()
|
|
@@ -161,7 +161,7 @@ if problem_type == "Classification":
|
|
| 161 |
elif dataset_type == "XOR":
|
| 162 |
fv, cv = generate_xor(400)
|
| 163 |
else:
|
| 164 |
-
fv, cv = generate_sine_wave(
|
| 165 |
|
| 166 |
# Feature preprocessing
|
| 167 |
std = StandardScaler()
|
|
|
|
| 146 |
y = np.logical_xor(X[:, 0] > 0, X[:, 1] > 0).astype(int)
|
| 147 |
return X, y
|
| 148 |
|
| 149 |
+
def generate_sine_wave(noise, n_samples=400): # Reordered: non-default before default
|
| 150 |
X = np.linspace(-3, 3, n_samples).reshape(-1, 1)
|
| 151 |
y = np.sin(X) + np.random.normal(0, noise / 100, X.shape)
|
| 152 |
return np.hstack([X, X**2]), y.ravel()
|
|
|
|
| 161 |
elif dataset_type == "XOR":
|
| 162 |
fv, cv = generate_xor(400)
|
| 163 |
else:
|
| 164 |
+
fv, cv = generate_sine_wave(noise_level, 400)
|
| 165 |
|
| 166 |
# Feature preprocessing
|
| 167 |
std = StandardScaler()
|