Skip to content

Instantly share code, notes, and snippets.

@smothiki
smothiki / island.go
Created January 7, 2024 16:04
island
func largestIsland(grid [][]int) int {
n:=len(grid)
if n==0{
return 0
}
visited:=make([][]bool,n)
for i:=0; i<n; i++ {
visited[i]=make([]bool,n)
}
islandArea:=make(map[int]int)
[
[
0.042575303465127945,
0.032765358686447144,
0.08288835734128952,
0.045591503381729126,
0.12116891145706177,
-0.6816873550415039,
-0.03048943541944027,
-0.21693657338619232,
import logging
import sys
import warnings
from urllib.parse import urlparse
import numpy as np
import pandas as pd
from sklearn.linear_model import ElasticNet
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
@smothiki
smothiki / onnx.py
Last active September 27, 2023 16:16
test file to convert sklian to onnx
!pip install onnx==1.13.1 onnxruntime skl2onnx
import logging
import sys
import warnings
from urllib.parse import urlparse
import numpy as np
import pandas as pd
from sklearn.linear_model import ElasticNet
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
# 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"