Posts

Showing posts with the label regression

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

Supervised Machine Learning Use Case: Prediction of House Prices

Image
  This is the application of supervised machine learning to real estate. The goal is to predict sale prices ($) for N selected properties in a state (N>>1000).  We are given a csv dataset as a NxM table, where M is the number of property features describing every aspect of the house and surroundings (typically, M<100).    The dataset is partitioned into the training, test and deployment subsets as 70:20:10%. The data preparation phase (Step 0) also includes data cleaning and editing to remove outliers, missing values, etc. Step 1 (regression) performs mean fitting of a continuous surface such as plane F(data;A) to the training data by updating the fitting parameters A.  The fitting parameter set that provides the minimum average error between predicted and input house prices is stored in an array A. Step 2 tests the solution A (current best output of Step 1) by computing the mean difference or error between actual and predicted house prices within the test dataset. The large