Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
med:lab_2 [2019/03/12 16:04] pszwed [Knowledge Explorer] |
med:lab_2 [2022/03/06 23:01] pszwed [Knowledge Explorer] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Metody Eksploracji | + | ===== Eksploracja |
| | ||
Line 21: | Line 21: | ||
--> | --> | ||
| | ||
- | Argumenty przekształceń | + | *Argumenty przekształceń |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
Line 47: | Line 47: | ||
* Punkt 2.5 :!: W tej wersji Weka grupowanie nie działa | * Punkt 2.5 :!: W tej wersji Weka grupowanie nie działa | ||
+ | --- | ||
+ | <code python> | ||
+ | from keras import layers | ||
+ | from keras import models | ||
+ | from keras.models import Sequential, | ||
+ | from keras.layers import Dense | ||
+ | from io import StringIO | ||
+ | import tensorflow as tf | ||
+ | import matplotlib.pyplot as plt | ||
+ | import numpy as np | ||
+ | |||
+ | # 005.arff | ||
+ | data = """ | ||
+ | -4.84295, | ||
+ | ... | ||
+ | """ | ||
+ | #enter data as a string | ||
+ | inp = StringIO(data) | ||
+ | x, y = np.loadtxt(inp, | ||
+ | X = np.stack((x, | ||
+ | |||
+ | tf.random.set_seed(1) | ||
+ | model = models.Sequential() | ||
+ | model.add(layers.InputLayer(input_shape=(X.shape[1], | ||
+ | model.add(layers.Dense(1)) | ||
+ | model.summary() | ||
+ | model.compile(optimizer=tf.keras.optimizers.RMSprop(???? | ||
+ | hist = model.fit(X, | ||
+ | |||
+ | |||
+ | y_pred = model.predict(X) | ||
+ | |||
+ | plt.scatter(x, | ||
+ | plt.plot(x, | ||
+ | plt.plot(x, | ||
+ | |||
+ | </ |