Nexclap

Classification Model for Criminals Included in Jail from a Crime Database

Predicting the criminals included in jails for crimes using different machine learning models using logistic regression we got 87% accuracy using decision tree we got 97% accuracy using support vector machine we got 87% accuracy

https://drive.google.com/file/d/17JVZ-u_jynjqIQk3H51IvgZ0uCKGr34h/view?usp=share_link

Calcuator

This is the calculator we started in class.

Correlation Coefficient

This program finds the correlation between two stocks.

import math spy = [170.66, 170.95, 170.70, 169.73, 169.18, 169.80, 169.31, 169.11, 169.61, 168.74, 166.38, 165.83] jpm = [56.54, 56.40, 56.10, 55.49, 55.30, 54.83, 54.52, 54.09, 54.29, 54.15, 53.29, 51.83] spysquared = [] for i in range(0, len(spy), 1): value = spy[i] squared = value ** 2 spysquared.append(squared) print("SPY squared list: ") print(spysquared) jpmsquared = [] for i in range(0, len(jpm), 1): valuejpm = jpm[i] squaredjpm = valuejpm ** 2 jpmsquared.append(squaredjpm) print("JPM squared list: ") print(jpmsquared) spyjpm = [] for i in range(0, len(spy), 1): num1 = spy[i] num2 = jpm[i] valueperiod = num1 * num2 spyjpm.append(valueperiod) print("The periods of spy and jpm multiplied are: ") print(spyjpm) def average(lst): return sum(spy) / len(spy) average = average(spy) print("Average of SPY is ", (average)) def averagejpm(lst): return sum(jpm) / len(jpm) averagejpm = averagejpm(jpm) print("Average of JPM is ", (averagejpm)) def averagespy2(lst): return sum(spysquared) / len(spy) averagespy2 = averagespy2(spysquared) print("Average of SPY squared is ", (averagespy2)) def averagejpm2(lst): return sum(jpmsquared) / len(jpm) averagejpm2 = averagejpm2(jpmsquared) print("Average of JPM sqared is ", (averagejpm2)) def averagespyjpm(lst): return sum(spyjpm) / 12 averagespyjpm = averagespyjpm(spyjpm) print("Average of SPY and JPM multiplied together is ", (averagespyjpm)) variancespy = averagespy2 - (average * average) print("The variance of SPY is ", (variancespy)) variancejpm = averagejpm2 - (averagejpm * averagejpm) print("The variance of JPM is ", (variancejpm)) covariance = (averagespyjpm) - (average * averagejpm) print("The covariance of SPY is ", (covariance)) correlation = covariance / math.sqrt(variancespy * variancejpm) print("The correlation between SPY and JPM is ", (correlation))
Announcements
  • Test Announcement from Nexclap

    Test message from nexclap - please ignore

    2023-02-13

  • Test message

    Test message from nexclap - please ignore

    2023-02-11

  • Test message

    Test message from nexclap - please ignore

    2023-02-11

  • View all