Skip to content

Instantly share code, notes, and snippets.

View shubham769's full-sized avatar

Shubham Goyal shubham769

View GitHub Profile
%%time
y_pred_torch=model_torch.predict(np.array(X_test))
%%time
y_pred_torch=model_torch.predict(np.array(X_test))
model_torch=convert(model,'pytorch')
model_torch.to('cuda')
%%time
#prediction of labels for test data
y_pred=model.predict(np.array(X_test))
%%time
#prediction of labels for test data
y_pred=model.predict(np.array(X_test))
model=RandomForestClassifier(n_estimators=300)
model.fit(X_train,y_train)
pima = pd.read_csv("diabetes.csv")
X = pima.iloc[:,:-1]
y = pima.iloc[:,-1]
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=1) # 70% training and 30% test
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestClassifier
from hummingbird.ml import convert
from sklearn.model_selection import train_test_split
!pip install hummingbird-ml
@shubham769
shubham769 / Pytorch.py
Created October 15, 2019 06:08
Tensors
# importing libraries
import numpy as np
import torch