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
''' | |
Use shap to build an a explainer. | |
:parameter | |
:param model: model instance (after fitting) | |
:param X_names: list | |
:param X_instance: array of size n x 1 (n,) | |
:param X_train: array - if None the model is simple machine learning, if not None then it's a deep learning model | |
:param task: string - "classification", "regression" | |
:param top: num - top features to display | |
:return |
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
''' | |
Extract info for each layer in a keras model. | |
''' | |
def utils_nn_config(model): | |
lst_layers = [] | |
if "Sequential" in str(model): #-> Sequential doesn't show the input layer | |
layer = model.layers[0] | |
lst_layers.append({"name":"input", "in":int(layer.input.shape[-1]), "neurons":0, | |
"out":int(layer.input.shape[-1]), "activation":None, | |
"params":0, "bias":0}) |
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
// ParsingCsvDemo.cpp : This file contains the 'main' function. Program execution begins and ends there. | |
// | |
#include <iostream> | |
#include <string> | |
#include <fstream> | |
#include <sstream> | |
#include <vector> | |
using namespace std; |
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 libraries | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import pandas as pd | |
import plotly.express as px | |
import plotly.graph_objects as go |
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 torch as th | |
""" | |
Author: Josue N Rivera (github.com/wzjoriv) | |
Date: 7/3/2021 | |
Description: Snippet of various clustering implementations only using PyTorch | |
Full project repository: https://github.com/wzjoriv/Lign (A graph deep learning framework that works alongside PyTorch) | |
""" | |
def random_sample(tensor, k): |
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
cmake_minimum_required(VERSION 3.4...3.18) | |
project(pybindtest) | |
add_subdirectory(pybind11) | |
pybind11_add_module(module_name main.cpp) |
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
#No Authentication | |
sheet_response = requests.post(sheet_endpoint, json=sheet_inputs) | |
#Basic Authentication | |
sheet_response = requests.post( | |
sheet_endpoint, | |
json=sheet_inputs, | |
auth=( | |
YOUR USERNAME, | |
YOUR PASSWORD, |
NewerOlder