Skip to content

Instantly share code, notes, and snippets.

# split-oriented DataFrame input
curl http://127.0.0.1:5000/invocations -H 'Content-Type: application/json' -d '{
"dataframe_split": {
"columns": ["a", "b", "c"],
"data": [[1, 2, 3], [4, 5, 6]]
}
}'
# record-oriented DataFrame input (fine for vector rows, loses ordering for JSON records)
curl http://127.0.0.1:5000/invocations -H 'Content-Type: application/json' -d '{
package main
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"sync"
"time"
)
@smothiki
smothiki / mlflow.py
Last active November 16, 2023 18:46
test example
# The data set used in this example is from http://archive.ics.uci.edu/ml/datasets/Wine+Quality
# P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis.
# Modeling wine preferences by data mining from physicochemical properties. In Decision Support Systems, Elsevier, 47(4):547-553, 2009.
!pip3 install scikit-learn pandas numpy
import os
import warnings
import sys
import pandas as pd
import numpy as np
@smothiki
smothiki / ESobject.md
Last active June 27, 2023 16:02
cassandra tables
{
    "doc": {
        "mappings": {
            properties:{
            "capabilities_tags":  {
            "type": "nested"
             "fields": {..}
            }
            "creation_date": {
@smothiki
smothiki / mlflowtest.py
Created July 20, 2022 18:02
mlflowtest.py
import os
import warnings
import sys
import pandas as pd
import numpy as np
from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score
from sklearn.model_selection import train_test_split
from sklearn.linear_model import ElasticNet
from urllib.parse import urlparse
package main
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"os"
@smothiki
smothiki / maxsubarray.go
Created September 15, 2021 05:41
maxsubarray
package main
import "fmt"
/*
{
int arr[] = { 2, 3, 4, 5, 7 };
int n = sizeof(arr) / sizeof(arr[0]);
int max_sum = maxSubArraySum(arr, 0, n - 1);
printf("Maximum contiguous sum is %d\n", max_sum);
@smothiki
smothiki / mergesort.go
Last active September 14, 2021 05:23
mergesort.go
package main
import (
"fmt"
)
var inversion int
func merge(arr []int, low, mid,high int){
leftarr:=make([]int,mid-low+1)
@smothiki
smothiki / dind.yaml
Created August 10, 2021 04:00
docker indocker
apiVersion: v1
kind: Pod
metadata:
name: dind
spec:
containers:
- name: dind
image: docker-registry.infra.cloudera.com/smothiki/web:docker
securityContext:
privileged: true
@smothiki
smothiki / imagehandler.go
Created May 27, 2021 22:35
imagehandler.go
kanikoCmdStr := fmt.Sprintf("executor --context %s --dockerfile %s --skip-tls-verify --destination %s",
tmpDir, dockerBuildFile, dockerImageTag)
package imagehandler
import (
"fmt"
"os"
)