Skip to content

Instantly share code, notes, and snippets.

View arshren's full-sized avatar

Renu arshren

View GitHub Profile
@arshren
arshren / Keras_Sequential
Created September 16, 2021 10:48
Build Keras Model using Sequential Technique
#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')
@arshren
arshren / LPA.py
Last active August 7, 2021 13:18
Label Propagation using Sklearn
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