sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
bd15558779c71462d619c4565eb522921130e53063812d73bd37f0cc69de8bed | Jupyter | 3,532 | 128 | # %% [markdown]
# # Faithfulness Evaluator
#
# This notebook uses the `FaithfulnessEvaluator` module to measure if the response from a query engine matches any source nodes.
# This is useful for measuring if the response was hallucinated.
# The data is extracted from the [New York City](https://en.wikipedia.org/wi... |
e7ce2624661c098b75dac3809d20580124bf0eccecb17540605eaaf180b8c351 | Jupyter | 3,535 | 99 | # %%
import matplotlib.pyplot as plt
import nbimporter
from functions import *
%matplotlib inline
# %%
out_dir='/home/mahdi/Desktop/valid'
n1,name1=count(out_dir)
# %%
def show(i,slic,cmap):
dir_sct='/home/mahdi/Desktop/valid/'+name1[i][0]+'/sct_seg/tsnr.nii'
dir_main='/home/mahdi/Desktop/valid/'+name1[i][0]... |
ecb826e033f6e80a8461416f22ac8ce413a6e250554fa8782424b76fd9251602 | Jupyter | 3,545 | 121 | # %% [markdown]
# ## Simulating spectral graph model frequency spectrum with `spectrome`: Usage example
# %% [markdown]
# 
# %% [markdown]
# ### Import modules with respective paths
# %%
# this path append is for binder only
import sys
sys.path.append("../../")
#spectrome modules
from spectrome.fo... |
07fdfb93dfbca81bb0efa4a2538151f4ce97884cda774da49303bd9f9c0bf960 | Jupyter | 3,549 | 142 | # %% [markdown]
# # BatchEvalRunner - Running Multiple Evaluations
#
# The `BatchEvalRunner` class can be used to run a series of evaluations asynchronously. The async jobs are limited to a defined size of `num_workers`.
#
# ## Setup
# %%
%pip install llama-index-llms-openai llama-index-embeddings-openai
# %%
# att... |
7a3b8ae221ddf00347e9dd7573b745d31bd8d8e6a122625ac356db2ebc5abcc8 | Jupyter | 3,558 | 99 | # %% [markdown]
# ## Using the coffeine filterbank for dedoding motor imagery
#
# This notebook is based on the [MNE example](https://mne.tools/dev/auto_examples/decoding/decoding_csp_eeg.html) and illustrates the construction of the filterbank models.
#
# First we load the data as in the original example.
# %%
impo... |
a885f13425033863474e45fa1a11fdf3728eac7741604d7a0b813d87fb9c22c0 | Jupyter | 3,568 | 107 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/custom_embeddings.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Custom Embeddings
# LlamaIndex support... |
e8346106766b3dea7e819e8c2f02d8db8781f46ea0ab9c6d4048b37c402bcd45 | Jupyter | 3,601 | 139 | # %%
import numpy as np
import xarray as xr
import pandas as pd
from scipy import stats
from pathta import Study
from frites.conn import conn_ii
from frites.core import gcmi_1d_cc
from frites import set_mpl_style
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib as mpl
import json
with open(".... |
9162ad86c7a1a5cbe678c704002ffb8eb88eea70e02bc075ea42d034616444fa | Jupyter | 3,628 | 78 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/oci_data_science.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Oracle Cloud Infrastructure (OCI) Data ... |
f21329c94ef8b159aa17da2309ad92d35ad8a07dbea94f5cb8ab633897d8a34a | Jupyter | 3,658 | 122 | # %%
import random
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import sklearn
import skopt
import dill
import json
from tqdm.auto import tqdm
import gc
import warnings
warnings.filterwarnings("ignore")
from utils.vis_db import discrete_cmap, patch_3d_axis, get_fi... |
cb61b3d1b60244b0be30e6789b89cf5216db24f2f34603a48a71b55bf3a090c4 | Jupyter | 3,666 | 111 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/mixedbreadai.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Mixedbread AI Embeddings
#
# Explore the c... |
dbba810cab23e60a3f2bfaf64d63e1c9c25e16124ae9c5c0b0eecf5a64a793e4 | Jupyter | 3,673 | 128 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/metadata_extraction/EntityExtractionClimate.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Entity Metadata Extract... |
4a85e357d788c9d96ce78b9b55bee6adcfa2f5597e1a9ee0d94c25cabdf06df8 | Jupyter | 3,677 | 92 | # %% [markdown]
# # Preprocess
#
# > **This integration has been discontinued.** The Preprocess service is no longer available and will not receive updates or support. Please remove this dependency from your projects.
#
# ---
#
# [Preprocess](https://preprocess.co) is an API service that splits any kind of document ... |
f81ed1e77eb7ab23ab3c5fdeb84eca346bdb927756a3cb9b3fdcf868e1f4a6db | Jupyter | 3,688 | 117 | # %% [markdown]
# # Amazon Neptune Graph Store
# %%
%pip install boto3
%pip install llama-index-llms-bedrock
%pip install llama-index-graph-stores-neptune
%pip install llama-index-embeddings-bedrock
# %% [markdown]
# ## Using Knowledge Graph with NeptuneDatabaseGraphStore
# %% [markdown]
# ### Add the required impor... |
edfa626780827138e87371286b90940acc42e086b34ef41cde059c6ece8d2bae | Jupyter | 3,708 | 58 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/evaluation/correctness_eval.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Correctness Evaluator
# %% [markdown]
... |
377d4b6def5707f1254daa9c9cf0ed7302a9845e7e1d48c32b922fff31c270a7 | Jupyter | 3,718 | 123 | # %% [markdown]
# ### Post-hoc analysis
# %%
import numpy as np
import pandas as pd
import pyls
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import seaborn as sns
from netneurotools import datasets, stats, plotting
from scipy.stats import zscore, pearsonr, ttest_ind
fr... |
28af4c4704c4fc8e978c576acaa173bb445bd388376e201090ff31598dccfa7e | Jupyter | 3,720 | 125 | # %% [markdown]
# MultiRAT preprocessing
# ================
# Joanes Grandjean
#
# 
#
# # Purpose
# In this section I generate the bare bone BIDS folder metadata ahead of an upload to opennenuro.org. Datasets acquired with standardRAT protocol were generated using proper BIDS conv... |
8d86b211e0b8cf3c40eb0c59c001ee847db2bef6ad6b8951ca823a0f6a0d81f4 | Jupyter | 3,721 | 132 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/metadata_extraction/PydanticExtractor.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Pydantic Extractor
#
# Here ... |
b2f9a4c195b11779c6090b8daf499458fa0c144fcefb937123476e9a8b32fbaf | Jupyter | 3,739 | 154 | # %% [markdown]
# # Visualize results, local splicing
# %% [markdown]
# ## Load Libraries
# %%
library(tidyverse)
library(ggplot2)
library(DT)
library(leafcutter)
library(reshape2)
library(gridExtra)
library(intervals) # needed for pretty strand arrow placement
library(foreach)
library(grid)
library(gtable)
library(g... |
1ad152a3a19dab6d7d8707154f47382f5a483064f1d2b82c5cd76d942b4697de | Jupyter | 3,750 | 146 | # %% [markdown]
# # Vertex AI
#
# **NOTE:** Vertex has largely been replaced by Google GenAI, which supports the same functionality from Vertex using the `google-genai` package. Visit the [Google GenAI page](https://docs.llamaindex.ai/en/stable/examples/llm/google_genai/) for the latest examples and documentation.
#
... |
b542a6e468a22aa24bc85439e02f4a4b3d32aa6adc53427d65a5a73fdb3382e1 | Jupyter | 3,750 | 129 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/managed/VertexAIDemo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Google Cloud LlamaIndex on Vertex AI for RAG
#... |
84000be3b7c48175fd309a0e05754b5fcd1de092b98be1e971525e606e8a55c2 | Jupyter | 3,773 | 110 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llm/openvino.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # OpenVINO GenAI LLMs
#
# [OpenVINO™](https://github.co... |
8c568ec5cc84908c33e548b9f3d43668de1198c986e2383cb071123922f72020 | Jupyter | 3,776 | 101 | # %% [markdown]
# # llamafile
#
# One of the simplest ways to run an LLM locally is using a [llamafile](https://github.com/Mozilla-Ocho/llamafile). llamafiles bundle model weights and a [specially-compiled](https://github.com/Mozilla-Ocho/llamafile?tab=readme-ov-file#technical-details) version of [`llama.cpp`](https:/... |
1f97dba75df70da476c11a0797a1cf4a803489c92c4074dc64ad61e0d0b9a0af | Jupyter | 3,783 | 108 | # %% [markdown]
# # Llama Packs Example
#
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llama_hub/llama_packs_example.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#
# This example shows you how... |
dd15fc45f4417c337234c752857d37ced3b1e187fab17838dfc6cac3a3a5bb2b | Jupyter | 3,783 | 106 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/multi_modal/azure_openai_multi_modal.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#
# # Multi-Modal LLM using Azure OpenAI GPT-4o mi... |
0169a5fbc722fc528e1c92c8927ce98ad0b6a21eaad36b1196f1de91a8e27095 | Jupyter | 3,796 | 144 | # %% [markdown]
# Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required... |
256fd0e7158ee8db3957c86d1be8d26e259ada9e8f7d4dca09d850d63a1d4b23 | Jupyter | 3,802 | 118 | # %%
## Load libraries
import pandas as pd
import numpy as np
# %%
'''
function name: fix_column_names
purpose: Fixing the column names, making them smaller, informative, and consistent
input: The raw counts dataframe for either genes or transcripts
output: Same dataframe with improved column names
'''
def fix_co... |
9c3c46610d3424f89991bd4b0f8bb3efd353f5f5b00607abcaeb41cae17708ae | Jupyter | 3,802 | 145 | # %% [markdown]
# ## Building Advanced RAG With LlamaParse
#
# In this notebook we will demonstrate the following:
#
# 1. Using LlamaParse.
# 2. Using Recursive Retrieval with LlamaParse to query tables/ text within a document hierarchically.
#
# [LlamaParse Documentation](https://github.com/run-llama/llama_parse/)
... |
9471e5de0f238808ed22ab77ce7d953e41659005370a960a3f4e6d4e33d0bce4 | Jupyter | 3,804 | 127 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llm/maritalk.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#
# # Maritalk
#
# ## Introduction
#
# MariTalk is an assistant develope... |
8634e53c85b6456ae9a9734953054634cd5a261cbe085aa49f24e5f068ed779f | Jupyter | 3,806 | 142 | # %% [markdown]
# # TiDB Graph Store
# %%
%pip install llama-index-llms-openai
%pip install llama-index-graph-stores-tidb
%pip install llama-index-embeddings-openai
%pip install llama-index-llms-azure-openai
# %%
# For OpenAI
import os
os.environ["OPENAI_API_KEY"] = "sk-xxxxxxx"
import logging
import sys
from llam... |
354f2a8dfd3179d38defcf1ecf4f12c7fe4b3c4bd335bbcde3c1776fe99f639d | Jupyter | 3,808 | 121 | # %% [markdown]
# Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required... |
0a03faf3ba6a0955e77a36a10645f0fb20c194534a3f2cc759c8256ab6d3c910 | Jupyter | 3,819 | 117 | # %%
import functools
import numpy as np
import pandas as pd
from scipy.stats import fisher_exact, binom_test
# %%
@functools.lru_cache()
def get_deg(tissue):
dft = pd.read_csv(config[tissue], sep='\t', index_col=0)
dft['Feature'] = dft.index
dft['Dir'] = np.sign(dft['t'])
if 'gene_id' in dft.columns:
... |
f9c27dff7c281aa04bfe1505a1db066c34a09aa7d30c4c8fb4d315e51199feea | Jupyter | 3,839 | 104 | # %%
from collections import defaultdict
import pandas as pd
from scipy.optimize import curve_fit
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
# %%
ysd_measure = pd.read_csv('data/05_ysd_low-throughput_measurements.csv')
lib = pd.read_csv('designs.csv')
lib.set_index('seq_id', drop=False, ... |
4543a48cb9ed3600fd1c6494ab0de7dbcb239ccd4df9e4124d580c064ca2f031 | Jupyter | 3,841 | 135 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/agent/mistral_agent.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Function Calling Mistral Agent
# %% [markdown]... |
47956aec68774ef81d2786c09912e682b686eaf7a1bd542d65ba23f8e6662ecd | Jupyter | 3,849 | 157 | # %%
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.graph_objects as go
#sns.set()
plt.style.use('ggplot')
# %%
def calculate_f1(precision, recall):
f1_score = (2 * precision * recall) / (precision + recall)
return round(f1_score, 2)
# %%
def process... |
0157762d1c5c1b371bc7df1d3b4c741886f04004103a6bf562523a8c9880cb12 | Jupyter | 3,853 | 98 | # %%
## Import libraries
import pandas as pd
import numpy as np
import csv
## Display all rows of pandas dataframes
pd.set_option('display.max_rows', None)
pd.set_option('display.max_colwidth', None)
# %%
'''
function name: parse_df_columns
purpose: parsing the last aggregate column of the gtf/gff3 into useful colu... |
155f0665673b54ca64fd29e39e6604ebd7e2a66133b6992e7d4f1a8a50942b67 | Jupyter | 3,865 | 149 | # %% [markdown]
# # Meth_Comp API usage
# %% [markdown]
# ## Import module
# %%
# Import main module
from pycoMeth.Comp_Report import Comp_Report, cpg_heatmap, cpg_ridgeplot, category_barplot, chr_ideogram_plot, tss_dist_plot
# optionally inport jupyter helper functions
from pycoMeth.common import head, jhelp, Kale... |
0e35b5b9efbaae52dbd3d9e6f322d2fa117dda2ba8e726868c2dea4eab9702c8 | Jupyter | 3,869 | 153 | # %%
<a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llm/deepinfra.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # DeepInfra
# %% [markdown]
# ## Installation
#
# First, install t... |
6e2e06fc8f6dc9f89603630223eb90811bd2f5a0ff03c5953b2a1cdb20447d43 | Jupyter | 3,869 | 154 | # %% [markdown]
# # Sample Summary
# %%
suppressMessages({library(dplyr)
library(SummarizedExperiment)})
# %% [markdown]
# ## Functions
# %%
get_mds <- function(){
mds_file = "/ceph/projects/v4_phase3_paper/inputs/genotypes/mds/_m/LIBD_Brain_TopMed.mds"
mds = data.table::fread(mds_file) %>%... |
6098a0516910e52ce6c662ec819cc8cd3c42e61f75cfbdc4075aa70addc7c59e | Jupyter | 3,904 | 126 | # %%
import numpy as np
import os
import sys
sys.path.append("../protein_autoencoder/")
import torch
from torch_geometric.utils import from_networkx
from torch_geometric.nn import radius_graph
from torch_geometric.data import Batch
from torch_geometric.loader import DataLoader
from model import ProAuto
import matplotli... |
e01620d4819994140e2979597fbf2605c656ff483efaadeb34cb5d551401799c | Jupyter | 3,904 | 82 | # %% [markdown]
# <a href="https://colab.research.google.com/github/dauparas/ProteinMPNN/blob/main/training/colab_training_example.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
!git clone https://github.com/dauparas/ProteinMPNN.git
# %%
!wge... |
ee8e47d8849ff8a5fbbaeebad5f19b56a0d9af454c53f968bc838366feda3ac4 | Jupyter | 3,905 | 122 | # %% [markdown]
# MultiRAT preprocessing
# ================
# Joanes Grandjean
#
# 
#
# # Purpose
# In this section I generate the bare bone BIDS folder metadata ahead of an upload to opennenuro.org. Datasets acquired with standardRAT protocol were generated using proper BIDS conv... |
88240afbc4c6445d39eccbe560eb0b417dfdb8aa05c80ef0851de2a2ba8fb658 | Jupyter | 3,910 | 110 | # %% [markdown]
#
# ## MERFISH and scRNA data preprocess
#
# We apply uniPort to integrate high-plex RNA imaging-based spatially resolved MERFISH data with scRNA-seq data. The MERFISH data includes 64,373 cells with 155 genes, and the scRNA-seq data includes 30,370 cells with 21,030 genes from six mice measured with ... |
c2a629bf3ec0e231abc96bc2beb91507bdef98193d354380ea75024457f1db91 | Jupyter | 3,928 | 133 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/agent/openai_agent_with_query_engine.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Agent with Query Engine Tools
... |
cc84aa9f8934d10982a5367a12b5e7d64787c1dc4313ec2ec6f6b6365f8bd164 | Jupyter | 3,944 | 140 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/chat_engine/chat_engine_context.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
#
# # Chat Engine - Condense Plus Cont... |
3dc4fd3096e2107de5eb1d25044ad4864f403f53d030691a10a2702674f4b623 | Jupyter | 3,951 | 94 | # %%
# %% [markdown]
# ## Creating an experiment - UPDATED MAR 29 2022
# %% [markdown]
# The first step towards starting the analysis pipeline and creating the `Experiment` object is to create a dictionary (`ExperimentMetainfo`) to collect the metadata fields required for initializing `Experiment`. In `ExperimentMet... |
046d0fdcc733c293cb804488867b360ff65673f1fe34c70d984015fa1fd7d118 | Jupyter | 3,976 | 111 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/ibm_watsonx.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # IBM watsonx.ai
#
# >WatsonxEmbeddings is a ... |
5fc98d702f767a026996780c7a59e946fc1d419b8f403c68fc9f3940a6b894a8 | Jupyter | 3,986 | 194 | # %% [markdown]
# # Genotype Differenciation
# %% [markdown]
# ## Imports
# %%
%load_ext autoreload
%autoreload 2
# %%
import warnings
import pandas as pd
import statsmodels.api as sm
from matplotlib.figure import Figure
import seaborn as sns
import panel as pn
import com_const as cc
import com_func as cf
import... |
3eafe74f99690b76aa9d01dc25be3e61a544aedeba44135685fc7c2331ab0868 | Jupyter | 3,987 | 155 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llm/llama_api.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Llama API
# %% [markdown]
# [Llama API](https://www.... |
7a837af4676392cd7f1d8d2afb44731719cd25f9ab1e8a2ae27c55621cdc30c4 | Jupyter | 3,996 | 119 | # %% [markdown]
# Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required... |
c262a0d4c14791e516b080d3e6c17a0fe77d0744b98939f4c8d9bfaa4c032746 | Jupyter | 4,007 | 130 | # %% [markdown]
# # Comparison with other datasets
# %%
import functools
import numpy as np
import pandas as pd
# %% [markdown]
# ## BrainSeq functions
# %%
config = {
'caudate': '../../../caudate/male_analysis/metrics_summary/_m/male_specific_DE_4features.txt',
'dlpfc': '../../../dlpfc/male_analysis/metrics... |
0c21ae81d7fc89b74046056ac49fdd6b8af0a9953e1399d2b2ce606ee8075d81 | Jupyter | 4,032 | 95 | # %% [markdown]
# ## notebook 03d: regression model on raw single trials
#
# Here we present the same linear regression model as in our main analysis in notebook nb_03a_linear_regression_modelling, but based on single trial data. We do not fulfil assumptions of normality of residuals or homoscedasticity, but show, tha... |
99aca7a3ff234352c7d3ea91d4f35934cc58dd2270b35fcfd219ab7fe1644bb5 | Jupyter | 4,032 | 95 | # %% [markdown]
# ## notebook 03c: regression model on raw single trials
#
# Here we present the same linear regression model as in our main analysis in notebook nb_03a_linear_regression_modelling, but based on single trial data. We do not fulfil assumptions of normality of residuals or homoscedasticity, but show, tha... |
bc7eff3568d24d228bb42e1ffc474b6ea92d6f5b028288fc55e645842ad1bc8a | Jupyter | 4,042 | 112 | # %% [markdown]
# Reproducing MEG Spectrum:
# ---
# This notebook shows how to reproduce MEG spectrums as shown in Figure 3 of the manuscript. We will use `freqMEGdata_8002-101.h5`, anonymous subject 8002-101's source localized MEG recording that is downsampled and filtered as an example.
# %%
# this path append is fo... |
9406f7948bbe29c984cd9e60170a81e0081291a98c1ced104acd6c39bd532a57 | Jupyter | 4,050 | 126 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/managed/vectaraDemo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # PostgresML Managed Index
# In this notebook we ... |
39a3c97d4d1892ddabf819b9b454787ffe17183fb25a748166bddde14a7bccb9 | Jupyter | 4,057 | 127 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/dashscope_embeddings.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
# DashScope Embeddings
# %% [markdown]
# If you'r... |
cf7454ad29d01a3f546a265ab20e10b063225bdf8b465ab386c3d5c606ff5c59 | Jupyter | 4,068 | 98 | # %%
import os
from evaluation.load import get_dictionary, get_test, get_colors, get_data
from evaluation.plots import *
import subprocess
from utils.utils import viz_cam
# %%
def run(data_path, result_path, color_path):
print(data_path, result_path, color_path)
result_paths = [ { 'name': name, 'path': os.path... |
cafa3e82e1c4145bf26561f78aafefa960423e2c63869ce35875c9a6b9cba804 | Jupyter | 4,071 | 116 | # %% [markdown]
# ## Mouse spleen integration
#
# We'll apply uniPort to integrate transcriptomic and epigenomic data using scATAC (gene activity matrix) and scRNA datasets profiled from mouse spleen, including 3166 cells with 19410 genes in scATAC and 4382 genes with 13575 genes in scRNA.
# %%
import uniport as up
i... |
b910e379dce471708495e550972a3b59e115976f7d31ef2852033f568951da25 | Jupyter | 4,073 | 91 | # %% [markdown]
# MultiRAT asset preparation
# ================
# Joanes Grandjean
#
# 
#
# ## Dowload and prepare the template
#
# For this project, I will use the SIGMA rat template available
# [here](https://www.nitrc.org/projects/sigma_template) The reference for
# the templa... |
835418eeb60bc209ed7ff0b6b62f46878ac7b6587ddb086d3a6d6b4b0ed9f040 | Jupyter | 4,077 | 141 | # %%
import pandas as pd
import yaml
from zephir.methods import build_annotations
from zephir.utils.utils import *
%matplotlib inline
from tqdm.notebook import tqdm
# %%
# path to Zephir dataset
dataset = Path('.')
# path to DeepLabCut project directory
path_to_dlc_project = Path('.')
# %%
# creating directories f... |
5bbe8549530c1d910016400d16415013af9ee25dc0d8bdb03dc040d95ba71b54 | Jupyter | 4,080 | 152 | # %% [markdown]
# Comparison of physical convolution and Fourier convolution from: https://stackoverflow.com/a/60584560/
# %%
import torch
import torch.nn.functional as F
import numpy as np
from timeit import default_timer
import pandas as pd
import warnings
# %%
def conv2d_pyt(f, g):
assert len(f.size()) == 3
... |
213eabb415f67e23dae09d99c833f9b162ea4a8b174f0102c9024010294c0606 | Jupyter | 4,090 | 99 | # %% [markdown]
# ## notebook 03a2: accuracy regression model on raw single trials
#
# Here we present the same linear regression model as in our main analysis in notebook nb_03a_linear_regression_modelling_accuracy, but based on single trial data. We do not fulfil assumptions of normality of residuals or homoscedasti... |
c2f1266ee1b6b444cabe9620f2bae51300736a08e6bcac16df0a35518ff834ba | Jupyter | 4,090 | 179 | # %% [markdown]
# # Knowledge Graph Index
#
# This tutorial gives a basic overview of how to use our `KnowledgeGraphIndex`, which handles
# automated knowledge graph construction from unstructured text as well as entity-based querying.
#
# If you would like to query knowledge graphs in more flexible ways, including p... |
1530b7f9fa9cb46504b27a60f135f0ad69e5a0b4e345f46927294917b9e69b66 | Jupyter | 4,091 | 124 | # %% [markdown]
# # Local Embeddings with OpenVINO
#
# [OpenVINO™](https://github.com/openvinotoolkit/openvino) is an open-source toolkit for optimizing and deploying AI inference. The OpenVINO™ Runtime supports various hardware [devices](https://github.com/openvinotoolkit/openvino?tab=readme-ov-file#supported-hardwar... |
6ba636a7cb228ff10b44026c038476fd8e008a13b9c5e6080b82764aea7ed334 | Jupyter | 4,102 | 172 | # %%
import os
import pandas as pd
# %%
df_tcga_old = pd.read_excel("/data/projects/robin/cell_free/LGG_TCGA_Idats_26092022/DE_LGG_TCGA/TCGA_LGG_IDHmut_Neurons_DMG analysis.xlsx",
index_col=0)
# %%
df_tcga = pd.read_excel("GBM_Methylom_TCGA_clinical-data.xlsx",
index_... |
acd06cbb60a253d20f5f46b73d8975942e04ad980a5320b32296055bd604aba4 | Jupyter | 4,113 | 158 | # %%
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.graph_objects as go
#sns.set()
plt.style.use('ggplot')
# %%
def calculate_f1(precision, recall):
f1_score = (2 * precision * recall) / (precision + recall)
return round(f1_score, 2)
# %%
def process... |
626bf1d26556c2b631e103599a05a41904e5c7ea050f50f269adca8da9d8a6bd | Jupyter | 4,127 | 114 | # %%
import os
import numpy as np
import pandas as pd
from brainrender import Scene, Animation, settings
from brainrender.actors import Points
from brainrender._colors import get_random_colors
from brainrender._video import Video
from vedo import embedWindow, Plotter, show
from brainrender.video import VideoMaker
impor... |
8b4e559c2a76379100e89dc446eec251c36df66e99afa9e344151677d680f904 | Jupyter | 4,137 | 157 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/voyageai.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # VoyageAI Embeddings
#
# MongoDB's VoyageAI Emb... |
8c7bb26725474cac64928c40d067a6896da1d44c599fe527d52dcc1c7885c383 | Jupyter | 4,140 | 101 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llm/nvidia_tensorrt.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # NVIDIA TensorRT-LLM
# %% [markdown]
# TensorRT... |
926538d175cfe7beb4b5cd8996a471c8d97b17b9b72d2a58fcc8b116b3f2e3bc | Jupyter | 4,158 | 197 | # %% [markdown]
# ### Step by Step OIV 452-1 predictor Training
# %% [markdown]
# ## Imports
# %%
%load_ext autoreload
%autoreload 2
# %%
import warnings
from pathlib import Path
import shutil
from tqdm import tqdm
import pandas as pd
from sklearn.metrics import (
confusion_matrix,
mean_squared_error,
... |
1b5ca3ed5d5dd9791c52954a2b26432dea8bbb3c54d115c18a980eaa574ccbb3 | Jupyter | 4,161 | 128 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/llm/ollama.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Ollama + `gpt-oss` Cookbook
#
# OpenAI's latest open-so... |
78173be7a29915f3fc6ffb24c5ba1b108fe4fbcca16d69e2848fcc76cea0d42a | Jupyter | 4,171 | 90 | # %% [markdown]
# ## Covariances in Data Frames for predictive modeling
#
# Coffeine is designed for building biomedical prediction models from M/EEG signals. The library provides a high-level interface facilitating the use of M/EEG covariance matrix as representation of the signal. The methods implemented here make u... |
1c7787982240d21a4a52fcd3cbb9dba5c7b5d68109c6a8165ec7880312e9d03f | Jupyter | 4,177 | 148 | # %% [markdown]
# # Pairwise Evaluator
#
# This notebook uses the `PairwiseEvaluator` module to see if an evaluation LLM would prefer one query engine over another.
# %%
%pip install llama-index-llms-openai
# %%
# attach to the same event-loop
import nest_asyncio
nest_asyncio.apply()
# %%
# configuring logger to... |
8fba0f9f3545e041b3668734bb7899441be5685a542b3c4fd0880d48e11d6bf3 | Jupyter | 4,203 | 152 | # %% [markdown]
# <a href="https://colab.research.google.com/gist/andreped/d40dbbd619867ac5fa26b640b19da815/ibdcolepi-load-dataset-example.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
# install OpenGL
!apt-get update && apt-get -y upgrade \
... |
34efb15f70897bafb770cdceaf3e4ffe45c100a6ce0ca6b601b4b424009caf75 | Jupyter | 4,205 | 181 | # %% [markdown]
# # Agents
#
# %% [markdown]
# ### Installation
# %%
!pip install llama-index
# %% [markdown]
# ### Setup LLM and Embedding Model
# %%
import nest_asyncio
nest_asyncio.apply()
import os
os.environ["OPENAI_API_KEY"] = "sk-..."
from llama_index.llms.openai import OpenAI
from llama_index.embedding... |
9e5a5db8953bb0324d78c951f3f125a61cfdcbb65d0e2a1c57321c9fef71e783 | Jupyter | 4,227 | 140 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/agent/bedrock_converse_agent.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Function Calling AWS Bedrock Converse ... |
a9065e3b2747164fed08d546b91e6eb5933c7a62b98bf32c6d1a92311e1f34ca | Jupyter | 4,275 | 134 | # %% [markdown]
# # Async Ingestion Pipeline + Metadata Extraction
#
# Recently, LlamaIndex has introduced async metadata extraction. Let's compare metadata extraction speeds in an ingestion pipeline using a newer and older version of LlamaIndex.
#
# We will test a pipeline using the classic Paul Graham essay.
# %%
... |
5990f4cc0de5af255ffd1f670f6fab296e3ff84be1642ec861e2376c2a2204b8 | Jupyter | 4,288 | 156 | # %%
import pandas as pd
import numpy as np
import nibabel as nib
import nbimporter
from functions import *
from numpy import *
import matplotlib.pyplot as plt
%matplotlib inline
import shutil
import os
import subprocess
import time
# %%
D7_dir='/home/mahdi/Desktop/data_selection_D7'
n,name=count(D7_dir)
out_dir='/h... |
c4bf1a7f3f9a2c1819a73dc6362636a22bc38e2ba418a4e8906e5cea0f7e5b23 | Jupyter | 4,305 | 113 | # %% [markdown]
# # Plot RXE comparisons
# %%
library(ggpubr)
library(tidyverse)
# %%
save_ggplots <- function(p, fn, w=7, h=7){
for(ext in c('.svg', '.png', '.pdf')){
ggsave(p, filename=paste0(fn, ext), width=w, height=h)
}
}
# %%
df = data.table::fread("../../_m/RXE_public.csv") |>
mutate_if(i... |
55b904551875839a8b7c44c72e9290e919ea883d5c6101fb27574584a6909943 | Jupyter | 4,308 | 134 | # %%
## DeepGBM Development
%config InlineBackend.figure_format = 'retina'
%matplotlib inline
import matplotlib.pyplot as plt
from typing import List
import sys, os
import numpy as np
from deeplift.dinuc_shuffle import dinuc_shuffle
from deeplift.visualization import viz_sequence
# import shap
from twobitreader impor... |
2a0d96f4ce78e8665271459a9b95ddefc10f9e22bede54c78f64d6b00d32414d | Jupyter | 4,314 | 123 | # %% [markdown]
# ## Mouse spleen integration
#
# We'll apply uniPort to integrate transcriptomic and epigenomic data using scATAC (gene activity matrix) and scRNA datasets profiled from mouse spleen, including 3166 cells with 19410 genes in scATAC and 4382 genes with 13575 genes in scRNA.
# %%
import uniport as up
i... |
45acda79e7f7e877cc63c739ce368221420fa640f278594f8f5a1c6d150c8c0b | Jupyter | 4,314 | 94 | # %% [markdown]
# ## notebook 05: position error precision vs accuracy regressions
#
# In this notebook we calculate accuracy and precision for each participant and condition for Figure 7 of the paper. We then compute a regression predicting accuracy from precision together with 95% confidence intervals.
# %%
# impor... |
7de7faa86e99503f5626acf4a8d5252319e6714671590c57122c8cd7d6765b07 | Jupyter | 4,340 | 94 | # %% [markdown]
# ## notebook 05: position error precision vs accuracy regressions
#
# In this notebook we calculate accuracy and precision for each participant and condition for Figure 7 of the paper. We then compute a regression predicting accuracy from precision together with 95% confidence intervals.
# %%
# impor... |
e2faac091bbe9204eb42d31d2046fda5a494f3c48337b4669c807d134bdcb828 | Jupyter | 4,341 | 126 | # %%
# 1st Cell
import polyfingerprints as pfp
import pandas as pd
import numpy as np
from wrapconfig import YAMLWrapConfig
import os
from polyfingerprints import models as pfp_models
import torch
# %%
# 2nd Cell: Specify the model details and the inference data source.
OUTDIR="out"
BASEMODEL_DIR=os.path.join(OUTDIR,"... |
f529fd7fc36cb6249b30969f0649b57715614b72d28ae6deceec0d64421d00c7 | Jupyter | 4,342 | 107 | # %%
# Helper function for reloading packages in Jupyter notebook
%load_ext autoreload
%autoreload 2
# %% [markdown]
# #### Installation
# %%
!pip install -q MRdataset
!pip install -q mrQA
# %% [markdown]
# #### Import Libraries
# %%
import IPython
from pathlib import Path
# %% [markdown]
# ## Introduction: Hands... |
387af8d05cef46ffecc0f79b2930881451ebd18813f7045ec1498e3f67895a5d | Jupyter | 4,345 | 138 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/multi_modal/dashscope_multi_modal.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#
# # Multi-Modal LLM using DashScope qwen-vl model f... |
cbac31877eaf9697159c80c1cc301fa42367a9b94d78d1f221294f5362f93d68 | Jupyter | 4,350 | 151 | # %% [markdown]
# Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required... |
536cd1adeb8736a12b9bb4a569ceff56ef7a50d52dd08180e01bde14d23f5c3a | Jupyter | 4,357 | 131 | # %%
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('paper')
sns.set_style('ticks')
# %%
def dCrawler(data, threshold):
"""
dCrawler clustering algorithm.
Args:
data (numpy.ndarray): The input data as a 2D numpy array.
threshold (float): The d... |
9e39c527a19a9d671f9623128bb5e90d7d8f9776d1821c106785371f3fa4a4ca | Jupyter | 4,377 | 117 | # %%
import numpy as np
import os
import miga_emblaze.emblaze as m_emb
from miga_emblaze.emblaze.utils import Field, ProjectionTechnique
import cv2
embedding_dir = '/rhome/lianyu.zhou/cache/cluster_test_set_gformer_l3_b256_atom60'
need = ['img', 'graph']
modal_num = len(need)
samples_num = 3000
embeddings_list = [np.... |
d663dce43942ff162e9ac96a4fcdbdf05a6ac863ea51834715883e75cdcfa12f | Jupyter | 4,398 | 200 | # %% [markdown]
# # Metadata Extraction
#
# In this notebook we will demonstrate following:
#
# 1. RAG using Metadata Extractors.
# 2. Extract Metadata using PydanticProgram.
# %% [markdown]
# ## Installation
# %%
!pip install llama-index
!pip install llama_index-readers-web
# %%
import nest_asyncio
nest_asyncio.... |
8559e3f91a5b6cb5bb34341e80e89870e7864e4a902ea7f051def82078aaecef | Jupyter | 4,408 | 154 | # %% [markdown]
# <a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/agent/mistral_agent.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Function Calling Anthropic Agent
# %% [markdow... |
306034784d0154f86146a42b3945a8ac9babf53ecc5b62dbf31907903815a670 | Jupyter | 4,411 | 187 | # %% [markdown]
# # Ensemble predictions of DNNs for potentially dominant woody species in Ticino and averaging across yeardays
# %% [markdown]
# ## Load necessary packages
# %%
# Import modules
import os
import torch
import numpy as np
import pandas as pd
import torch.nn.functional as F
# Custom module
import model... |
df08462e6f9d864e7b6a70c0698794c76987cf94065c7f48b0c653788feff73b | Jupyter | 4,418 | 140 | # %% [markdown]
# # Using QCArchive with the OpenFF Toolkit
#
# Here we show how to create OpenFF molecules safely from data in the QCArchive using the CMILES entries. This transformation relies on the `"canonical_isomeric_explicit_hydrogen_mapped_smiles"`.
#
# First load up the client you wish to connect to, in this... |
fc2df7d0cd59199ba7fb790a4b674ccd604105c09fd10bba260e27b45045d7df | Jupyter | 4,419 | 144 | # %% [markdown]
# # Contextual Retrieval With Llama Index
#
# This notebook covers contextual retrieval with llama_index DocumentContextExtractor
#
# Based on an Anthropic [blost post](https://www.anthropic.com/news/contextual-retrieval), the concept is to:
# 1. Use an LLM to generate a 'context' for each chunk based... |
5758b41a0b4f7057966fd97c8423620c9d61fd228daa4b857c77cec78bde972c | Jupyter | 4,423 | 92 | # %% [markdown]
# ## notebook 03 b: including interaction effect
# Especially for the effect from 3 to 99 objects we have seen that participant individuality plays an important role. Therefore we would like to include an interaction term between condition and participant in our initial model. However, as you see in thi... |
8c1ca268fd60c853655182a98a90ae6a521abbf15a0bc7e32ada700c1c010fa3 | Jupyter | 4,428 | 133 | # %%
!pip install pingouin
# %%
from google.colab import drive
drive.mount("/content/gdrive")
# %%
from pathlib import Path
import h5py
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patheffects as pe
import seaborn as sns
import pandas as pd
import scipy.stats as sstats
import... |
65c83a46ff666af320c3220aa9ddd56673920dd54e5c7e6bb7719616fa0f567f | Jupyter | 4,429 | 158 | # %%
import pymaid
import matplotlib.pyplot as plt
rm = pymaid.CatmaidInstance('server_url', 'api_token', 'http_user', 'http_password')
nl = pymaid.get_neurons('annotation:glomerulus DA1 right excitatory')
# Access single attribute: e.g. cable lengths [um]
nl.cable_length
# %%
# .. or get a full summary as pandas D... |
1d260c8d342a52d66157269f0099d97d200c9681a787f7028c200bfba5d194cf | Jupyter | 4,446 | 166 | # %% [markdown]
# # MongoDB Demo
#
# This guide shows you how to directly use our `DocumentStore` abstraction backed by MongoDB. By putting nodes in the docstore, this allows you to define multiple indices over the same underlying docstore, instead of duplicating data across indices.
#
# <a href="https://colab.resear... |
b51f23316a30020741f88a0e05c7a36cbec805d7c65790a1faffb16bfc97f9d9 | Jupyter | 4,446 | 166 | # %% [markdown]
# # Redis Ingestion Pipeline
#
# This walkthrough shows how to use Redis for both the vector store, cache, and docstore in an Ingestion Pipeline.
# %% [markdown]
# ## Dependencies
#
# Install and start redis, setup OpenAI API key
# %%
%pip install llama-index-storage-docstore-redis
%pip install llam... |
ab5800f8e8cb0b51135e81a05c573e74415237acf3664ef7e339c1d53c9689c0 | Jupyter | 4,448 | 119 | # %%
## Import Libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import csv
## Display all rows of pandas dataframes
pd.set_option('display.max_rows', None)
pd.set_option('display.max_colwidth', None)
# %%
'''
function name: parse_dff_columns
purpose: parsing the la... |
4206a6c66aedd4a0ef76a748a4ba7add390a7610981e560d80ce2028f80ed481 | Jupyter | 4,456 | 137 | # %% [markdown]
# <a href="https://colab.research.google.com/drive/104BZb4U1KLzOYArnCzhqN-CqJWZDeqhz?usp=sharing" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Interacting with LLM deployed in Amazon SageMaker Endpoint with LlamaIndex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.