Skip to content

Instantly share code, notes, and snippets.

View alisatl's full-sized avatar

Alisa Zhila alisatl

View GitHub Profile
@alisatl
alisatl / pie_plots.py
Created June 4, 2020 00:04
Pandas Pie Plots
import pandas as pd
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
ordered_groups = merch_group_metrics_pdf_retail.index
@alisatl
alisatl / categorical_bar_plot.py
Last active June 3, 2020 19:30
Bar plot ordered by categories in Pandas
import pandas as pd
judgements = ['strong', 'attribute mismatch', 'weak/related', 'unrelated', 'unjudged']
for key, report in reports.items():
report['judgement'] = pd.Categorical(report['judgement'], categories=judgements, ordered=True)
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
@alisatl
alisatl / check_model_fit.py
Created March 30, 2019 01:18
Handy classification evaluation function
# Evaluation function
import pandas as pd
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
from sklearn.metrics import precision_recall_fscore_support as pr
from sklearn.metrics import roc_curve, auc
from IPython.display import display
import matplotlib.pyplot as plt
@alisatl
alisatl / Makefile.config
Created November 8, 2016 18:25
Sample Caffe Mekefile.config for Python Anaconda + NO CUDA/CPU ONLY
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
{
"response":{"numFound":3,"start":0,"docs":[]
},
"facet_counts":{
"facet_queries":{},
"facet_fields":{
"text":[
"Elasticsearch",2,
"Solr",3,
"Solr 5.5",1,
{
"response":{"numFound":2,"start":0,"docs":[]
},
"facet_counts":{
"facet_queries":{},
"facet_fields":{
"text":[
"Elasticsearch",2,
"Solr",2,
"Solr 5.5",1,
{
"response":{"numFound":3,"start":0,"docs":[]
},
"facets":{
"count":3,
"filter_by_child_type":{
"count":9,
"top_entity_text":{
"buckets":[{
"val":"Solr",
{
"response":{"numFound":2,"start":0,"docs":[]
},
"facets":{
"count":2,
"filter_by_child_type":{
"count":9,
"top_keywords":{
"buckets":[{
"val":"Elasticsearch",
{
"response":{"numFound":2,"start":0,"docs":[]
},
"facets":{
"count":2,
"filter_by_child_type":{
"count":3,
"comment_sentiments":{
"buckets":[{
"val":"negative",
{
"response":{"numFound":1,"start":0,"docs":[
{
"text":["Yeah, I like Solr too"]}]
},
"facets":{
"count":1,
"blog_authors_with_positive_replies":{
"buckets":[{
"val":"Alice",