Skip to content

Instantly share code, notes, and snippets.

View samyumobi's full-sized avatar
🍇
__/\__ Namaste ! Vanakam

Samyuktha samyumobi

🍇
__/\__ Namaste ! Vanakam
View GitHub Profile
@samyumobi
samyumobi / main.py
Last active October 2, 2022 16:11
Car Price Prediction
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import OneHotEncoder
from sklearn.compose import make_column_transformer
from sklearn.pipeline import make_pipeline
from sklearn.metrics import r2_score
@samyumobi
samyumobi / nltk-excercises.ipynb
Created August 9, 2022 11:11
NLTK Excercises.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from airflow.models import DAG
from airflow.contrib.sensors.file_sensor import FileSensor
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from airflow.operators.python_operator import BranchPythonOperator
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.email_operator import EmailOperator
from dags.process import process_data
from datetime import datetime, timedelta
@samyumobi
samyumobi / predicting-credit-card-approvals.ipynb
Created July 22, 2022 12:09
Predicting-Credit-Card-Approvals.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@samyumobi
samyumobi / car-damage-detection-colab.ipynb
Created January 5, 2022 06:20
car-damage-detection-colab.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from google.colab.patches import cv2_imshow
## load new image and convert to gray scale
f2 = sys.argv[1]
img2 = cv2.imread('/iPhone_camera_1615895489376.webp',cv2.IMREAD_GRAYSCALE)
## ht, width of image
h, w = img2.shape
## horizontal edge detection
sobel_h = cv2.Sobel(img2, cv2.CV_64F, 1, 0, ksize = 5)
## Vertical edge detection
## Load the image
f3 = sys.argv[1]
img3 = img
## convert image to grayscale and display img
img3_gray = cv2.cvtColor(img3, cv2.COLOR_BGR2GRAY)
cv2_imshow(img3_gray)
## histogram equalization of color images
img3c = cv2.cvtColor(img3,cv2.COLOR_BGR2YUV)
## equalize the pixels across y channel and display
img3c[:,:,0] = cv2.equalizeHist(img3c[:,:,0])
import sys, cv2
import matplotlib.pyplot as plt
## Load the image
f = sys.argv[1]
img = cv2.imread('/a.jpeg')
## display the image
plt.imshow(img)
plt.show()
# Scaling the data
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import Pipeline
po = [('scaler',StandardScaler()),('logistic_reg',LogisticRegression(C=10))]
p = Pipeline(po)
lr4 = p.fit(X_train, Y_train)
print("Scaled Accuracy score : ",100*lr4.score(X_test,Y_test),"% \n")
# Logistic Regression coefficients
### Hyper parameter tuning Logistic Regression model
from sklearn.model_selection import GridSearchCV
from sklearn import linear_model
from sklearn.pipeline import make_pipeline
lr = linear_model.LogisticRegression(solver ='lbfgs', penalty = 'l2')
# Use gridsearch CV to search for the bes parameter