This notebook demonstrates calculating taylor series for certain polynomials.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
from urllib.request import Request, urlopen | |
modelreq = Request("https://raw.githubusercontent.com/SharanSMenon/ml-models/master/sentiment_analysis/scikit-learn/sentiment_model.p") # Getting the model | |
vectorreq = Request("https://raw.githubusercontent.com/SharanSMenon/ml-models/master/sentiment_analysis/scikit-learn/vectorizer.p") # Getting the vectorizer | |
m = urlopen(modelreq) | |
v = urlopen(vectorreq) | |
model = pickle.load(m) | |
vectorizer = pickle.load(v) | |
def predict(s): | |
transformed = vectorizer.transform([s]).toarray() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import timeit # For performance testing | |
# Function on line below | |
f = lambda x: x**2 # Replace the function seen here with your function | |
def integrate_rectangular(N, a, b): | |
""" | |
Integrates the function given the bounds b and a, by using Riemann Sums. | |
""" | |
value = 0 | |
value2 = 0 |