Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fa2c509

Browse files
author
Algorithmica
authored
Add files via upload
1 parent f77e17e commit fa2c509

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import sys
2+
path = 'E://New Folder/utils'
3+
sys.path.append(path)
4+
5+
import regression_utils as rutils
6+
from sklearn import model_selection
7+
8+
9+
#linear pattern in 2d
10+
X, y = rutils.generate_linear_synthetic_data_regression(n_samples=200, n_features=1,
11+
n_informative=1,
12+
noise = 100)
13+
X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, test_size=0.1, random_state=1)
14+
rutils.plot_data_2d_regression(X_train, y_train)
15+
16+
#non-linear pattern in 2d
17+
X, y = rutils.generate_nonlinear_synthetic_data_regression(n_samples=200, n_features=1)
18+
X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, test_size=0.1, random_state=1)
19+
rutils.plot_data_2d_regression(X_train, y_train)
20+
21+
#linear pattern in 3d
22+
X, y = rutils.generate_linear_synthetic_data_regression(n_samples=200, n_features=2,
23+
n_informative=2,
24+
noise = 10)
25+
X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, test_size=0.1, random_state=1)
26+
rutils.plot_data_3d_regression(X_train, y_train)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /