This file contains hidden or 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
from sklearn import datasets | |
from sklearn.semi_supervised import LabelPropagation | |
from sklearn.metrics import confusion_matrix, classification_report | |
import numpy as np | |
rnd = np.random.RandomState(42) | |
# load the cancer dataset | |
cancer = datasets.load_breast_cancer() | |
# Randomly unlabel some records in the dataset |
This file contains hidden or 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 required libraries | |
import tensorflow as tf | |
from keras.datasets import mnist | |
#Creating the MNIST Dataset | |
(x_train, y_train), (x_test, y_test) = mnist.load_data() | |
x_train, x_test= x_train/255.0, x_test/255.0 | |
x_train=x_train[...,tf.newaxis].astype('float32') | |
x_test=x_test[...,tf.newaxis].astype('float32') |
This file contains hidden or 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 required libraries | |
import tensorflow as tf | |
from keras.datasets import mnist | |
#Creating the MNIST Dataset | |
(x_train, y_train), (x_test, y_test) = mnist.load_data() | |
x_train, x_test= x_train/255.0, x_test/255.0 | |
x_train=x_train[...,tf.newaxis].astype('float32') | |
x_test=x_test[...,tf.newaxis].astype('float32') |
This file contains hidden or 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 required libraries | |
import tensorflow as tf | |
from keras.datasets import mnist | |
#Creating the MNIST Dataset | |
(x_train, y_train), (x_test, y_test) = mnist.load_data() | |
x_train, x_test= x_train/255.0, x_test/255.0 | |
x_train=x_train[...,tf.newaxis].astype('float32') | |
x_test=x_test[...,tf.newaxis].astype('float32') |
This file contains hidden or 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
--- | |
title: "Titanic Data Analysis" | |
output: html_document | |
author: Authored by Renu | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` | |
# Data Analysis of Titanic dataset using R Markdown |
This file contains hidden or 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 numpy as np | |
import cv2 | |
frame_count=0 | |
# Open the Video | |
video = cv2. VideoCapture('people_motion.avi') | |
# read the fiurst frame of the video as the initial background image | |
ret, Prev_frame= video.read() | |
This file contains hidden or 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
# importing libraries | |
from PIL import Image | |
import numpy as np | |
import cv2 | |
import math | |
# setting variables | |
tracking_people={} | |
person_id=0 | |
frame_num = 0 |
This file contains hidden or 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 the necessary packages | |
from scipy.spatial import distance as dist | |
import numpy as np | |
import imutils | |
from imutils import contours | |
from imutils import perspective | |
import cv2 | |
# detect aruco marker | |
def findArucoMarkers(img, markerSize = 6, totalMarkers=100, draw=True): |
This file contains hidden or 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 libararies | |
import numpy as np | |
import pandas as pd | |
import os | |
import torch_geometric.transforms as T | |
from torch_geometric.datasets import Planetoid | |
import matplotlib.pyplot as plt | |
import torch | |
import torch.nn.functional as F |
This file contains hidden or 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
# Fibonaci of 5 using recursion | |
def calc_fibonaci(n): | |
if n<=1: | |
return n | |
return calc_fibonaci(n-1) + calc_fibonaci(n-2) | |
print(calc_fibonaci(6)) | |
# Memoization | |
def calc_fibonaci(n): | |
cache=[-1 for x in range(n+1)] |
OlderNewer