Python ML and DL

Python Resources


Spoken tutorial IIT Bomabay

Good Resources: Python Programming


# Import necessary packages
import numpy as np
import pandas as pd
import seaborn as sb
import matplotlib.pyplot as plt
% matplotlib inline
import warnings
from sklearn import linear_model
from sklearn.ensemble import RandomForestClassifier
import xgboost
from sklearn.metrics import explained_variance_score
from xgboost import XGBClassifier


pip list | grep -F package_name
import sys
!pip freeze  ( list of modules)   or
!pip list
import fastai
import pandas
print( pandas.__version__)
pip list | grep -F package_name

TypeError: stackplot() got multiple values for argument ‘x’

from matplotlib import pyplot as plt
plt.stackplot([1,2,3], [1,2,3])

Should be equivalent to

fig, ax = plt.subplots()
ax.stackplot([1,2,3], [1,2,3])




How to install fastai v1 on Windows 10



To see packages with pip

pip freeze


import torch


Julia + Juno

using Pkg

using IJulia



!pip install –upgrade tensorflow

!pip –version

conda create -n Python27 python=2.7
source activate Python27

%%file ( Create File Name)


!python ( To run)



conda install -c aaronzs tensorflow-gpu
conda install -c anaconda cudatoolkit
conda install -c anaconda cudnn
conda install -c anaconda cudatoolkit



at first time, anaconda install cuda9 for me.
after run conda install -c anaconda cudnn, it shows cudnn 7.14 for cuda 8 is installed, also cuda 9 will be down to cuda8.


import sys


!python -V


import warnings
warnings.simplefilter(action=”ignore”, category=FutureWarning)


# keras imports
from keras.applications.vgg16 import VGG16, preprocess_input
from keras.applications.vgg19 import VGG19, preprocess_input
from keras.applications.xception import Xception, preprocess_input
from keras.applications.resnet50 import ResNet50, preprocess_input
from keras.applications.inception_resnet_v2 import InceptionResNetV2, preprocess_input
from keras.applications.mobilenet import MobileNet, preprocess_input
from keras.applications.inception_v3 import InceptionV3, preprocess_input
from keras.preprocessing import image
from keras.models import Model
from keras.models import model_from_json
from keras.layers import Input

# other imports
from sklearn.preprocessing import LabelEncoder
import numpy as np
import glob
import cv2
import h5py
import os
import json
import datetime
import time






from google.colab import drive



!ls “/content/drive/My Drive/”

!ls “/content/drive/My Drive/Colab_MyDataset”


!python3 “/content/drive/My Drive/Colab_MyDataset/Vikas_Testing_Malaria/malaria_cell_classification_code/”


!wget -P “/content/drive/My Drive/Colab_MyDataset”


Change Directory

import os

os.chdir(“drive/My Drive/Colab_MyDataset/Vikas_Testing_Malaria/malaria_cell_classification_code”)


PU Rohan MSC. Dept


from google.colab import drive


import os

os.chdir(‘/content/drive/My Drive/COLAB_NOTEBOOKS/PU_Rohan’)


from google.colab import files
uploaded = files.upload()



Stock Prices Prediction Using Machine Learning and Deep Learning Techniques (with Python codes)


How to Setup Your Python Environment for Machine Learning with Anaconda  ( Data Science)


%d bloggers like this: