This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function to_formal(input="That was funny LOL") { | |
const endpointUrl = "https://qw2w1h.us-east-1.aws.endpoints.huggingface.cloud"; | |
const options = { | |
"method" : "POST", | |
"contentType" : "application/json", | |
"payload" : JSON.stringify({"inputs": input}), | |
"headers" : { | |
"Authorization" : "Bearer api_org_TOKEN" | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint | |
def score(data, port = "6789"): | |
b_buf = BytesIO() | |
b_buf.write(data.to_csv(index=False).encode("utf-8")) | |
b_buf.seek(0) | |
url = "http://localhost:{}/predict/".format(port) | |
files = [ | |
('X', b_buf) | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from sklearn.ensemble import RandomForestRegressor | |
import pickle | |
import datetime | |
## load data | |
df = pd.read_csv('/content/odsc-ml-drum/data/boston_housing.csv') | |
df.head() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""classic Acrobot task""" | |
##Updated by Rajiv Shah to get the pendulum to balance for an extended time | |
from gym import core, spaces | |
from gym.utils import seeding | |
import numpy as np | |
from numpy import sin, cos, pi | |
import time | |
__copyright__ = "Copyright 2013, RLPy http://acl.mit.edu/RLPy" | |
__credits__ = ["Alborz Geramifard", "Robert H. Klein", "Christoph Dann", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'babel-polyfill'; | |
import React, {Component} from 'react'; | |
import {render} from 'react-dom'; | |
import DeckGL from 'deck.gl/react'; | |
import {LineLayer} from 'deck.gl'; | |
import {ArcLayer} from 'deck.gl'; | |
import MapGL from 'react-map-gl'; | |
const token = 'Add yours here'; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Forked from Ed Küpfer and Asteves | |
#https://gist.github.com/edkupfer | |
#https://gist.github.com/asteves/7266330 | |
#Updated to rotate half court 90 degrees | |
#Generate Data for the 3 point line | |
# Define the circle; add a point at the center if the 'pie slice' if the shape is to be filled | |
circleFun <- function(center=c(0,5.25), diameter=20.9, npoints=20000, start=0, end=1, filled=TRUE){ | |
tt <- seq(start*pi, end*pi, length.out=npoints) |