Skip to content

Instantly share code, notes, and snippets.

View Justus-coded's full-sized avatar

Justus Ilemobayo Justus-coded

View GitHub Profile
@Justus-coded
Justus-coded / colab.py
Created December 21, 2020 03:36
Installing a module permanently in Google colab
import os, sys
from google.colab import drive
drive.mount('/content/gdrive')
#create a path to save the module
nb_path = '/content/notebooks'
os.symlink('/content/gdrive/My Drive/Colab Notebooks', nb_path)
sys.path.insert(0, nb_path)
@Justus-coded
Justus-coded / RandomizedSearchCV.py
Created December 5, 2020 17:13
Hyperparameter tuning using RandomizedSearchCV
#Import libraries
import numpy as np
from scipy.stats import randint
from catboost import CatBoostClassifier
from sklearn.model_selection import RandomizedSearchCV
# load data
cancer = datasets.load_breast_cancer()
# target
@Justus-coded
Justus-coded / GridSearchCV.py
Last active December 5, 2020 17:01
Hyperparameter tuning using Grid Search
#import libraries
from sklearn import datasets
from catboost import CatBoostClassifier
from sklearn.model_selection import GridSearchCV
# load data
cancer = datasets.load_breast_cancer()
# target
y = cancer.target
@Justus-coded
Justus-coded / Manual_tuning.py
Last active December 5, 2020 16:43
Hyperparameter tuning of Machine learning models using manual tuning
#import libraries
from sklearn import datasets
from catboost import CatBoostClassifier
from sklearn.model_selection import cross_val_score
# load data
cancer = datasets.load_breast_cancer()
# target
y = cancer.target
@Justus-coded
Justus-coded / Employee Salaries.sql
Created September 30, 2020 14:33
Hackerrank SQL Challenge
/*
Write a query that prints a list of employee names (i.e.: the name attribute) for employees in
Employee having a salary greater than 2000 per month who have been employees for less than months.
Sort your result by ascending employee_id.
*/
SELECT name
FROM Employee
WHERE (salary > 2000) AND (months< 10)
ORDER BY employee_id;
@Justus-coded
Justus-coded / Employee Names.sql
Created September 30, 2020 14:14
Hackerrank SQL Challenge
/*
Write a query that prints a list of employee names (i.e.: the name attribute) from the Employee table in alphabetical order.
*/
SELECT name
FROM Employee
ORDER BY name;
@Justus-coded
Justus-coded / Higher Than 75 Marks.sql
Created September 30, 2020 14:10
Hackerrank SQL Challenge
/*
Query the Name of any student in STUDENTS who scored higher than Marks. Order your output by the last three characters of each name. If two or more students both have names ending in the same last three characters (i.e.: Bobby, Robby, etc.), secondary sort them by ascending ID.
*/
SELECT Name
FROM STUDENTS
WHERE Marks > 75
ORDER BY RIGHT(Name, 3) , ID ;
@Justus-coded
Justus-coded / Weather Observation Station 12.sql
Created September 30, 2020 13:48
Hackerrank SQL Challenge
/*
Query the list of CITY names from STATION that do not start with vowels and do not end with vowels. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE (RIGHT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U')) AND (LEFT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U'))
@Justus-coded
Justus-coded / Weather Observation Station 11.sql
Created September 30, 2020 13:45
Hackerrank SQL Challenge
/*
Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE (RIGHT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U')) OR (LEFT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U'))
@Justus-coded
Justus-coded / Weather Observation Station 10.sql
Created September 30, 2020 13:40
Hackerrank SQL Challenge
/*
Query the list of CITY names from STATION that do not end with vowels. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE RIGHT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U')