Skip to content

Instantly share code, notes, and snippets.

View agbozo1's full-sized avatar

Ebenezer Agbozo agbozo1

View GitHub Profile
# 10_basic.py
# 15_make_soup.py
# 20_search.py
# 25_navigation.py
# 30_edit.py
# 40_encoding.py
# 50_parse_only_part.py
@duttashi
duttashi / kfold-cv-custom-function.R
Created July 11, 2017 09:56
A simple function to perform k-fold cross validation in R
#Randomly shuffle the data
yourdata<-yourdata[sample(nrow(yourdata)),]
#Create 10 equally size folds
folds <- cut(seq(1,nrow(yourdata)),breaks=10,labels=FALSE)
#Perform 10 fold cross validation
for(i in 1:10){
#Segement your data by fold using the which() function
testIndexes <- which(folds==i,arr.ind=TRUE)
testData <- yourdata[testIndexes, ]
trainData <- yourdata[-testIndexes, ]
@scrapehero
scrapehero / oddsportal.json
Last active January 26, 2021 13:57
Sitemap to extract details of fixtures of England's premier league from the top bookmakers using webscraper.io chrome extension
{
"_id":"oddsportal",
"startUrl":[
"https://www.oddsportal.com/soccer/england/premier-league/"
],
"selectors":[
{
"id":"match",
"type":"SelectorLink",
"parentSelectors":[
@neelriyer
neelriyer / boilerplate_flask.py
Last active July 2, 2021 10:54
detectron2 web app boilerplate flask code
import io
from flask import Flask, render_template, request, send_from_directory, send_file
from PIL import Image
import requests
import os
import urllib.request
app = Flask(__name__)
@app.route("/")