Posts

Showing posts with the label scikit learn

Ml/AI Regression for Stock Prediction - AAPL Use Case

Image
  The following is a set of steps intended for ML/AI regression to predict stock prices. The objective is to simulate available historical stock prices of $AAPL using the SciKit Learn library. 1. Install Yahoo finance library !pip install yfinance 2. Let's call  all dependencies that we will use for this exercise  import pandas as pd import numpy as np import math  import seaborn as sns  import matplotlib.pyplot as plt from sklearn import metrics from sklearn.model_selection import train_test_split import yfinance as yf  # We will use this library to upload latest data from Yahoo API %matplotlib inline plt.style.use('fivethirtyeight') 3. Define the ticker you will use nio = yf.Ticker('AAPL') #Display stock information, it will give you a summary description of the ticker nio.info {'zip': '95014', 'sector': 'Technology', 'fullTimeEmployees': 100000, 'longBusinessSummary': 'Apple Inc. designs, manufactures, and