Neural Networks

Python में Finance के लिए Machine Learning

Nathan George

Data Science Professor

GPU के लिए Moore's law

Python में Finance के लिए Machine Learning

Neural networks की संभावनाएँ

Neural nets में होते हैं:

  • non-linearity
  • variable interactions
  • customizability
Python में Finance के लिए Machine Learning

बेसिक neural net डायग्राम

Python में Finance के लिए Machine Learning

बेसिक गणित के साथ net डायग्राम

Python में Finance के लिए Machine Learning

neural net गणित

Python में Finance के लिए Machine Learning

एक्टिवेशन neural net डायग्राम

Python में Finance के लिए Machine Learning

एक्टिवेशन फंक्शन

Python में Finance के लिए Machine Learning

लॉस फंक्शन

Python में Finance के लिए Machine Learning

फॉरवर्ड पास

Python में Finance के लिए Machine Learning

बैकवर्ड पास

Python में Finance के लिए Machine Learning

keras और tensorflow लोगो

Python में Finance के लिए Machine Learning

keras के साथ neural net बनाना

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
Python में Finance के लिए Machine Learning

keras के साथ neural net बनाना

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense


model = Sequential()
model.add(Dense(50, input_dim=scaled_train_features.shape[1], activation='relu')) model.add(Dense(10, activation='relu')) model.add(Dense(1, activation='linear'))
Python में Finance के लिए Machine Learning

मॉडल फिट करना

model.compile(optimizer='adam', loss='mse')
history = model.fit(scaled_train_features, 
                    train_targets, 
                    epochs=50)
Python में Finance के लिए Machine Learning
plt.plot(history.history['loss'])
plt.title('loss:' + str(round(history.history['loss'][-1], 6)))
plt.xlabel('epoch')
plt.ylabel('loss')
plt.show()

लॉस प्लॉट

Python में Finance के लिए Machine Learning

परफॉर्मेंस जाँचें

from sklearn.metrics import r2_score

# calculate R^2 score
train_preds = model.predict(scaled_train_features)
print(r2_score(train_targets, train_preds))
0.4771387560719418
Python में Finance के लिए Machine Learning

परफॉर्मेंस प्लॉट करें

# plot predictions vs actual
plt.scatter(train_preds, train_targets)
plt.xlabel('predictions')
plt.ylabel('actual')
plt.show()

प्रेडिक्शन्स बनाम वास्तविक

Python में Finance के लिए Machine Learning

एक neural net बनाएँ!

Python में Finance के लिए Machine Learning

Preparing Video For Download...