- Profiler by DB Name
- Profile by login account name
Link - Download
Jasper Report passing parameter between datasets
Happy Learning!!!
Deep Learning - Machine Learning - Data(base), NLP, Video - SQL Learning's - Startups - (Learn - Code - Coach - Teach - Innovate) - Retail - Supply Chain
from keras.applications import VGG19 | |
from keras.applications import imagenet_utils | |
from keras.preprocessing.image import img_to_array | |
from keras.preprocessing.image import load_img | |
import numpy as np | |
input_shape = (224,224) | |
preprocess = imagenet_utils.preprocess_input | |
image = load_img("E:\RNotes\DL\man.png", target_size = input_shape) | |
image = img_to_array(image) | |
image = np.expand_dims(image,axis=0) | |
image = preprocess(image) | |
#model = VGG19(weights="imagenet") | |
model = VGG19(weights="imagenet") | |
preds = model.predict(image) | |
p = imagenet_utils.decode_predictions(preds) | |
print(p) | |
#VGG19 | |
#Women | |
#[[('n03770439', 'miniskirt', 0.47218892), ('n03594734', 'jean', 0.20757468), ('n02963159', 'cardigan', 0.022973826), ('n03450230', 'gown', 0.021934472), ('n03000247', 'chain_mail', 0.02097792)]] | |
#man | |
#[[('n03594734', 'jean', 0.31298622), ('n03630383', 'lab_coat', 0.26774961), ('n04456115', 'torch', 0.083450332), ('n04296562', 'stage', 0.04125011), ('n04370456', 'sweatshirt', 0.021016017)]] | |
#Approach #1 | |
from sklearn import svm | |
from imblearn.over_sampling import SMOTE | |
#SMOTE and SVM | |
y1 = df['loan_status'] | |
x1 = df[features] | |
sm = SMOTE(kind='svm') | |
x, y = sm.fit_sample(x1, y1) | |
model = svm.SVC(decision_function_shape='ovo') | |
model.fit(x,y) | |
predictions = model.predict(x_test) | |
#Approach #2 | |
#PCA & SVM | |
from sklearn.decomposition import PCA | |
from sklearn.svm import SVC | |
y1 = df['loan_status'] | |
x1 = df[features] | |
pca = PCA(n_components=10) | |
x1_train_pca = pca.fit_transform(x1) | |
clf=SVC(probability=True) | |
clf.fit(x1_train_pca,y1) | |
pca = PCA(n_components=10) | |
x_test_pca = pca.fit_transform(x_test) | |
predictions = clf.predict_proba(x_test_pca) | |
--Table Creation for Date Dimension Upto Minute level | |
IF OBJECT_ID ('DimDateTime') IS NOT NULL DROP TABLE DimDateTime | |
GO | |
CREATE TABLE [dbo].[DimDateTime]( | |
[DATEKEY] [bigint] NOT NULL, | |
[DateATime] [datetime] NOT NULL, | |
[HourOfDay] [int] NOT NULL, | |
[MinuteOfDay] [int] NOT NULL, | |
[DayofWeekName] [int] NOT NULL, | |
[WeekInt] [int] NOT NULL, | |
[MonthInt] [int] NOT NULL, | |
[QuarterInt] [int] NOT NULL, | |
[YearInt] [int] NOT NULL | |
CONSTRAINT [pk_DimDateTime] PRIMARY KEY CLUSTERED | |
( | |
[DATEKEY] ASC | |
)) | |
--Date Dimension Data Population Script | |
DECLARE @StartDate DATETIME, @EndDate DATETIME | |
SET @StartDate = '2014-01-01' | |
SET @EndDate = '2018-01-01' | |
WHILE (@StartDate < @EndDate) | |
BEGIN | |
INSERT INTO [dbo].[DimDateTime] | |
([DATEKEY],[DateATime],[MinuteOfDay],[HourOfDay],[DayofWeekName],[WeekInt],[MonthInt],[QuarterInt],[YearInt]) | |
select convert(bigint,LEFT(CONVERT(varchar(20),@StartDate,112) + REPLACE(CONVERT(varchar(5),@StartDate,108),':',''),12)), | |
@StartDate, | |
DATEPART(minute,@StartDate), | |
DATEPART(hour,@StartDate), | |
DATEPART(dw,@StartDate), | |
DATEPART(wk,@StartDate), | |
DATEPART(mm,@StartDate), | |
DATEPART(qq,@StartDate), | |
YEAR(@StartDate) | |
SET @StartDate = DATEADD(minute,1,@StartDate) | |
END | |
For questions/feedback/career opportunities/training / consulting assignments/mentoring - please drop a note to sivaram2k10(at)gmail(dot)com
Coach / Code / Innovate