python_code stringlengths 0 4.04M | repo_name stringlengths 7 58 | file_path stringlengths 5 147 |
|---|---|---|
from setuptools import setup, find_packages
setup(name='observational', version='1.0', packages=find_packages())
| observational-main | setup.py |
import numpy as np
import torch
import torch.nn as nn
from scipy.stats import norm
from skimage.util.shape import view_as_windows
from sklearn.metrics import (
f1_score,
roc_auc_score,
recall_score,
)
import os
import pickle
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.metrics im... | observational-main | utils.py |
from typing import List
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
class SoftCrossEntropyLoss(nn.Module):
"""
Calculate the CrossEntropyLoss with soft targets
:param weight: Weight to assign to each of the classes. Default: None
:type weight: list of f... | observational-main | end_model/soft_cross_entropy.py |
observational-main | end_model/__init__.py | |
#!/usr/bin/env python
# coding: utf-8
#
# Author: Kazuto Nakashima
# URL: http://kazuto1011.github.io
# Created: 2017-05-26
from collections import Sequence
import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional as F
from tqdm import tqdm
import pdb
class _BaseWrapper(object):... | observational-main | end_model/grad_cam.py |
# Convolutional neural network (three convolutional layers)
import torch
import torch.nn as nn
import torchvision
class ConvNet(nn.Module):
def __init__(self, num_classes=10):
super(ConvNet, self).__init__()
self.layer1 = nn.Sequential(
nn.Conv2d(3, 16, kernel_size=5, stride=2, padding... | observational-main | end_model/cnn.py |
import os, sys
import numpy as np
import torch
from emmental.data import EmmentalDataset
from PIL import Image
import pydicom
sys.path.append("../")
from utils import (
load_file_markers,
load_helper_task_labels,
load_weak_labels,
standardize_label,
)
import pdb
num_gaze_dims_dict = {
"none": ... | observational-main | end_model/dataset.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import pickle
from open3d import visualization as o3dv
import random
import argparse
import numpy as np
import time
import contactopt.util as ut... | ContactOpt-main | contactopt/run_eval.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from os import path as osp
import numpy as np
import json
import matplotlib.pyplot as plt
import torch
import pytorch3d
from manopth i... | ContactOpt-main | contactopt/util.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import datetime
def parse_dataset(args):
""" Converts the --split argument into a dataset file """
if args.split == 'a... | ContactOpt-main | contactopt/arguments.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
| ContactOpt-main | contactopt/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from contactopt.loader import *
import contactopt.util as util
from contactopt.hand_object import HandObject
import time
from open3d import io a... | ContactOpt-main | contactopt/visualize.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import pytorch3d.ops
from contactopt.util import *
from pytorch3d.structures import Meshes
def capsule_sdf(mesh_verts, mesh_norma... | ContactOpt-main | contactopt/diffcontact.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import trimesh
import json
import contactopt.util as util
import contactopt.arguments as arguments
from contactopt.hand_objec... | ContactOpt-main | contactopt/run_user_demo.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import pytorch3d
import time
from contactopt.loader import *
from manopth.manolayer import ManoLayer
from manopth import rodrigues_... | ContactOpt-main | contactopt/optimize_pose.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from torch.utils.data import Dataset
from contactopt.util import *
import torch
import numpy as np
from pytorch3d.structures import Meshes
impor... | ContactOpt-main | contactopt/loader.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import pickle
from contactopt.hand_object import HandObject
import open3d
from tqdm import tqdm
from scipy.spatial.transform ... | ContactOpt-main | contactopt/create_dataset_im.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
import contactopt.pointnet as pointnet
import torch.nn.functional as F
from pytorch3d import ops, transforms
... | ContactOpt-main | contactopt/deepcontact_net.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from contactopt.loader import ContactDBDataset
from contactopt.deepcontact_net import DeepContactNet
import glob
import argparse
from contactopt... | ContactOpt-main | contactopt/run_contactopt.py |
"""Pytorch-Geometric implementation of Pointnet++
Original source available at https://github.com/rusty1s/pytorch_geometric"""
import torch
import torch.nn.functional as F
from torch.nn import Sequential as Seq, Linear as Lin, ReLU, BatchNorm1d as BN
from torch_geometric.datasets import ModelNet
import torch_geometric... | ContactOpt-main | contactopt/pointnet.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from os import path
import sys
import numpy as np
import pickle
from tqdm import tqdm
from joblib import Parallel, delayed
import multiprocessin... | ContactOpt-main | contactopt/create_dataset_contactpose.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import hand_object
import os
import util
from scipy.linalg import orthogonal_procrustes
from scipy.spatial.transform import R... | ContactOpt-main | contactopt/geometric_eval.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from os import path as osp
import numpy as np
from open3d import io as o3dio
from open3d import geometry as o3dg
from open3d import utility as o... | ContactOpt-main | contactopt/hand_object.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import numpy as np
from torch.utils.data import DataLoader
from tensorboardX import SummaryWriter
import contactopt.arguments as ar... | ContactOpt-main | contactopt/train_deepcontact.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import argparse
import os
parser = argparse.ArgumentParser(description='Generate Data')
parser.add_argument('--env-name',... | ddr-master | generate_dynamics_data.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import math
import numpy as np
import os
import time
from itertools import chain
import torch
import torch.nn.functional ... | ddr-master | train_online.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import numpy as np
import gym
from gym.spaces.box import Box
from rllab.envs.mujoco.swimmer_env import SwimmerEnv
from rl... | ddr-master | envs.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import math
import numpy as np
import os
import time
import torch
import torch.nn.functional as F
import torch.optim as o... | ddr-master | train_reward_module.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import math
import numpy as np
import os
import time
from itertools import chain
import torch
import torch.nn as nn
impor... | ddr-master | train_dynamics_module.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import argparse
def get_args():
parser = argparse.ArgumentParser(description='Train Modules')
# Learning paramet... | ddr-master | arguments.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import time
from collections import deque
import torch
import torch.nn.functional as F
from torch.autograd import Variabl... | ddr-master | test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
def no... | ddr-master | model.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import math
import sys
from datetime import datetime
import torch
import torch.nn.functional as F
from torch.autograd imp... | ddr-master | common.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import print_function
import argparse
import numpy as np
import os
import random
from operator import ite... | ddr-master | eval.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import print_function
import datetime
import os
import time
import shutil
from itertools import chain
imp... | ddr-master | main.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import math
import numpy as np
import os
import time
import torch
import torch.nn.functional as F
import torch.optim as o... | ddr-master | eval_modules.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import math
import torch
import torch.optim as optim
class SharedAdam(optim.Adam):
"""Implements Adam algorithm wit... | ddr-master | my_optim.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
import fire
from llama import Llama
def main(
ckpt_dir: str,
tokenizer_path: str,
temperature: float = 0.0,
top_p: float = 0.9,
max_... | codellama-main | example_infilling.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
from typing import Optional
import fire
from llama import Llama
def main(
ckpt_dir: str,
tokenizer_path: str,
temperature: float = 0.2,
... | codellama-main | example_instructions.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
from typing import Optional
import fire
from llama import Llama
def main(
ckpt_dir: str,
tokenizer_path: str,
temperature: float = 0.2,
... | codellama-main | example_completion.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
from setuptools import find_packages, setup
def get_requirements(path: str):
return [l.strip() for l in open(path)]
setup(
name="codellama",
... | codellama-main | setup.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
import json
import os
import sys
import time
from pathlib import Path
from typing import List, Literal, Optional, Tuple, TypedDict
import torch
import tor... | codellama-main | llama/generation.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
from .generation import Llama
from .model import ModelArgs, Transformer
from .tokenizer import Tokenizer
| codellama-main | llama/__init__.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
import math
from dataclasses import dataclass
from typing import Any, Optional, Tuple
import fairscale.nn.model_parallel.initialize as fs_init
import torc... | codellama-main | llama/model.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
import os
from logging import getLogger
from typing import List, Optional
from sentencepiece import SentencePieceProcessor
logger = getLogger()
class ... | codellama-main | llama/tokenizer.py |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
import torch.nn as nn
import torch.nn.functional as F
from layers import convnet, co... | daqa-master | daqa-mod/film.py |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
import torch.nn as nn
from layers import StackedAttention, StackedAttention1D, convn... | daqa-master | daqa-mod/models.py |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
import torch.nn as nn
import torch.nn.functional as F
from layers import convnet, co... | daqa-master | daqa-mod/malimo.py |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import argparse
import os
# import numpy as np
import torch
import torch.distributed as dist
impo... | daqa-master | daqa-mod/main.py |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
import torch.nn as nn
import torch.nn.functional as F
def convnet(num_conv_filts, n... | daqa-master | daqa-mod/layers.py |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import json
import re
import h5py
import torch
from torch.utils.data.dataloader import default_co... | daqa-master | daqa-mod/data.py |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import argparse
import os
import h5py
import numpy as np
import scipy
import scipy.io.wavfile
im... | daqa-master | daqa-mod/compute_audio_features.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import argp... | daqa-master | daqa-gen/generate_questions_answers.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
# Events with urls are a subset of AudioSet, see https://research.google.com/audioset/.
from __future__ import (absolute_... | daqa-master | daqa-gen/daqa_sources.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import json... | daqa-master | daqa-gen/daqa_outline.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import argp... | daqa-master | daqa-gen/generate_audio.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import argp... | daqa-master | daqa-gen/daqa.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import nump... | daqa-master | daqa-gen/qpas/query.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import nump... | daqa-master | daqa-gen/qpas/exist.py |
daqa-master | daqa-gen/qpas/__init__.py | |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import re
i... | daqa-master | daqa-gen/qpas/utils.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import nump... | daqa-master | daqa-gen/qpas/compare.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import nump... | daqa-master | daqa-gen/qpas/count.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import nump... | daqa-master | daqa-gen/qpas/compare_integer.py |
from unittest import TestCase
from base import AbstractFeatureSelector
import numpy as np
from scipy import stats
from scipy.sparse import issparse
from sklearn.feature_selection import f_classif, SelectFromModel, SelectPercentile
from sklearn.linear_model import Lasso
from sklearn.svm import LinearSVC
from sklearn.... | d3m-model-search-master | test_data/185_baseball/185_baseball_solution/src/feature_selection.py |
from base import AbstractEstimator
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.kernel_approximation import RBFSampler
from sklearn.linear_model import SGDClassifier, SGDRegressor
class SGDClassifierEstimator(AbstractEstimator):
param_distributions = {
'loss'... | d3m-model-search-master | test_data/185_baseball/185_baseball_solution/src/estimation.py |
d3m-model-search-master | test_data/185_baseball/185_baseball_solution/src/__init__.py | |
from collections import defaultdict, OrderedDict
import numpy as np
from scipy import signal
from scipy.sparse import csr_matrix, hstack
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.cluster import MiniBatchKMeans
from sklearn.feature_extraction.text import TfidfVectorizer
fr... | d3m-model-search-master | test_data/185_baseball/185_baseball_solution/src/feature_extraction.py |
# -*- coding: utf-8 -*-
# file: d3mds.py
# lab: MIT Lincoln Lab
# author(s): sw26425
# description: a rudimentary API for interacting with D3MDataSupply, which mainly consists of a Dataset and a Problem
import os, json, sys
import pandas as pd
import numpy as np
import warnings
DATASET_SCHEMA_VERSION = '3.0'
PROBLEM_... | d3m-model-search-master | test_data/185_baseball/185_baseball_solution/src/d3mds.py |
import os, sys, json
import pandas as pd
from sklearn.pipeline import Pipeline
from sklearn.linear_model import SGDClassifier
from sklearn.metrics import f1_score, mean_squared_error
here = os.path.dirname(os.path.abspath(__file__))
from d3mds import D3MDataset, D3MProblem, D3MDS
from feature_extraction import *
from... | d3m-model-search-master | test_data/185_baseball/185_baseball_solution/src/pipeline.py |
from abc import ABC, abstractmethod
from collections import OrderedDict
import numpy as np
from numpy import ndarray
from scipy.sparse import csr_matrix
from pandas import DataFrame
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.feature_selection.base import SelectorMixin
# https://stackoverflow... | d3m-model-search-master | test_data/185_baseball/185_baseball_solution/src/base.py |
# -*- coding: utf-8 -*-
# file: d3mds.py
# lab: MIT Lincoln Lab
# author(s): sw26425
# description: a rudimentary API for interacting with D3MDataSupply, which mainly consists of a Dataset and a Problem
import os, json, sys
import pandas as pd
import numpy as np
import warnings
DATASET_SCHEMA_VERSION = '3.0'
PROBLEM_... | d3m-model-search-master | test_data/test_cases_only/LL0_acled/LL0_acled_solution/src/d3mds.py |
# coding: utf-8
import numpy as np
import pandas as pd
import os, json, sys, random
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, confusion_matr... | d3m-model-search-master | test_data/test_cases_only/LL0_acled/LL0_acled_solution/src/pipeline.py |
# -*- coding: utf-8 -*-
# file: d3mds.py
# lab: MIT Lincoln Lab
# author(s): sw26425
# description: a rudimentary API for interacting with D3MDataSupply, which mainly consists of a Dataset and a Problem
import os, json, sys
import pandas as pd
import numpy as np
import warnings
DATASET_SCHEMA_VERSION = '3.0'
PROBLEM_... | d3m-model-search-master | test_data/test_cases_only/30_personae/30_personae_solution/src/d3mds.py |
# coding: utf-8
# In[1]:
import nltk, os, glob, sys
import pandas as pd
from normalization import normalize_corpus, tokenize_text
import numpy as np
import codecs
from sklearn.datasets.base import Bunch
from sklearn.cross_validation import train_test_split
from sklearn.model_selection import cross_val_score, Shuffl... | d3m-model-search-master | test_data/test_cases_only/30_personae/30_personae_solution/src/pipeline.py |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 27 04:03:12 2016
@author: DIP
"""
from sklearn.feature_extraction.text import CountVectorizer
def bow_extractor(corpus, ngram_range=(1,1)):
vectorizer = CountVectorizer(min_df=1, ngram_range=ngram_range)
features = vectorizer.fit_transform(corpus)
retur... | d3m-model-search-master | test_data/test_cases_only/30_personae/30_personae_solution/src/feature_extractors.py |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 26 20:45:10 2016
@author: DIP
"""
from contractions import CONTRACTION_MAP
import re, os
import nltk
import string
from nltk.stem import WordNetLemmatizer
import pandas as pd
here = os.path.dirname(os.path.abspath(__file__))
#stopword_list = nltk.corpus.stopwords.words... | d3m-model-search-master | test_data/test_cases_only/30_personae/30_personae_solution/src/normalization.py |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 01 01:11:02 2016
@author: DIP
"""
CONTRACTION_MAP = {
"ain't": "is not",
"aren't": "are not",
"can't": "cannot",
"can't've": "cannot have",
"'cause": "because",
"could've": "could have",
"couldn't": "could not",
"couldn't've": "could not have",
"didn't": "did not",
"does... | d3m-model-search-master | test_data/test_cases_only/30_personae/30_personae_solution/src/contractions.py |
# -*- coding: utf-8 -*-
# file: d3mds.py
# lab: MIT Lincoln Lab
# author(s): sw26425
# description: a rudimentary API for interacting with D3MDataSupply, which mainly consists of a Dataset and a Problem
import os, json, sys
import pandas as pd
import numpy as np
import warnings
DATASET_SCHEMA_VERSION = '3.0'
PROBLEM_... | d3m-model-search-master | test_data/test_cases_only/uu1_datasmash/uu1_datasmash_solution/src/d3mds.py |
import os, sys, json, random
import pandas as pd
import numpy as np
from sklearn.base import BaseEstimator
import pyflux as pf
here = os.path.dirname(os.path.abspath(__file__))
from d3mds import D3MDataset, D3MProblem, D3MDS
dspath = os.path.join(here, '..', '..', 'uu1_datasmash_dataset')
prpath = os.path.join(here,... | d3m-model-search-master | test_data/test_cases_only/uu1_datasmash/uu1_datasmash_solution/src/pipeline.py |
from unittest import TestCase
from base import AbstractFeatureSelector
import numpy as np
from scipy import stats
from scipy.sparse import issparse
from sklearn.feature_selection import f_classif, SelectFromModel, SelectPercentile
from sklearn.linear_model import Lasso
from sklearn.svm import LinearSVC
from sklearn.... | d3m-model-search-master | test_data/test_cases_only/185_baseball/185_baseball_solution/src/feature_selection.py |
from base import AbstractEstimator
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.kernel_approximation import RBFSampler
from sklearn.linear_model import SGDClassifier, SGDRegressor
class SGDClassifierEstimator(AbstractEstimator):
param_distributions = {
'loss'... | d3m-model-search-master | test_data/test_cases_only/185_baseball/185_baseball_solution/src/estimation.py |
d3m-model-search-master | test_data/test_cases_only/185_baseball/185_baseball_solution/src/__init__.py | |
from collections import defaultdict, OrderedDict
import numpy as np
from scipy import signal
from scipy.sparse import csr_matrix, hstack
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.cluster import MiniBatchKMeans
from sklearn.feature_extraction.text import TfidfVectorizer
fr... | d3m-model-search-master | test_data/test_cases_only/185_baseball/185_baseball_solution/src/feature_extraction.py |
# -*- coding: utf-8 -*-
# file: d3mds.py
# lab: MIT Lincoln Lab
# author(s): sw26425
# description: a rudimentary API for interacting with D3MDataSupply, which mainly consists of a Dataset and a Problem
import os, json, sys
import pandas as pd
import numpy as np
import warnings
DATASET_SCHEMA_VERSION = '3.0'
PROBLEM_... | d3m-model-search-master | test_data/test_cases_only/185_baseball/185_baseball_solution/src/d3mds.py |
import os, sys, json
import pandas as pd
from sklearn.pipeline import Pipeline
from sklearn.linear_model import SGDClassifier
from sklearn.metrics import f1_score, mean_squared_error
here = os.path.dirname(os.path.abspath(__file__))
from d3mds import D3MDataset, D3MProblem, D3MDS
from feature_extraction import *
from... | d3m-model-search-master | test_data/test_cases_only/185_baseball/185_baseball_solution/src/pipeline.py |
from abc import ABC, abstractmethod
from collections import OrderedDict
import numpy as np
from numpy import ndarray
from scipy.sparse import csr_matrix
from pandas import DataFrame
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.feature_selection.base import SelectorMixin
# https://stackoverflow... | d3m-model-search-master | test_data/test_cases_only/185_baseball/185_baseball_solution/src/base.py |
from unittest import TestCase
from base import AbstractFeatureSelector
import numpy as np
from scipy import stats
from scipy.sparse import issparse
from sklearn.feature_selection import f_classif, SelectFromModel, SelectPercentile
from sklearn.linear_model import Lasso
from sklearn.svm import LinearSVC
from sklearn.... | d3m-model-search-master | test_data/test_cases_only/1491_one_hundred_plants_margin/1491_one_hundred_plants_margin_solution/modules/feature_selection.py |
from base import AbstractEstimator
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.kernel_approximation import RBFSampler
from sklearn.linear_model import SGDClassifier, SGDRegressor
class SGDClassifierEstimator(AbstractEstimator):
param_distributions = {
'loss'... | d3m-model-search-master | test_data/test_cases_only/1491_one_hundred_plants_margin/1491_one_hundred_plants_margin_solution/modules/estimation.py |
d3m-model-search-master | test_data/test_cases_only/1491_one_hundred_plants_margin/1491_one_hundred_plants_margin_solution/modules/__init__.py | |
from collections import defaultdict, OrderedDict
import numpy as np
from scipy import signal
from scipy.sparse import csr_matrix, hstack
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.cluster import MiniBatchKMeans
from sklearn.feature_extraction.text import TfidfVectorizer
fr... | d3m-model-search-master | test_data/test_cases_only/1491_one_hundred_plants_margin/1491_one_hundred_plants_margin_solution/modules/feature_extraction.py |
# -*- coding: utf-8 -*-
# file: d3mds.py
# lab: MIT Lincoln Lab
# author(s): sw26425
# description: a rudimentary API for interacting with D3MDataSupply, which mainly consists of a Dataset and a Problem
import os, json
import pandas as pd
import numpy as np
import warnings
DATASET_SCHEMA_VERSION = '3.0'
PROBLEM_SCHEM... | d3m-model-search-master | test_data/test_cases_only/1491_one_hundred_plants_margin/1491_one_hundred_plants_margin_solution/modules/d3mds.py |
import os, sys, json
import pandas as pd
from sklearn.pipeline import Pipeline
from sklearn.linear_model import SGDClassifier
from sklearn.metrics import f1_score, mean_squared_error
here = os.path.dirname(os.path.abspath(__file__))
from d3mds import D3MDataset, D3MProblem, D3MDS
from feature_extraction import *
from... | d3m-model-search-master | test_data/test_cases_only/1491_one_hundred_plants_margin/1491_one_hundred_plants_margin_solution/modules/pipeline.py |
from abc import ABC, abstractmethod
from collections import OrderedDict
import numpy as np
from numpy import ndarray
from scipy.sparse import csr_matrix
from pandas import DataFrame
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.feature_selection.base import SelectorMixin
# https://stackoverflow... | d3m-model-search-master | test_data/test_cases_only/1491_one_hundred_plants_margin/1491_one_hundred_plants_margin_solution/modules/base.py |
# -*- coding: utf-8 -*-
# file: d3mds.py
# lab: MIT Lincoln Lab
# author(s): sw26425
# description: a rudimentary API for interacting with D3MDataSupply, which mainly consists of a Dataset and a Problem
import os, json, sys
import pandas as pd
import numpy as np
import warnings
DATASET_SCHEMA_VERSION = '3.0'
PROBLEM_... | d3m-model-search-master | test_data/test_cases_only/59_umls/59_umls_solution/src/d3mds.py |
# coding: utf-8
# In[23]:
import networkx as nx
import numpy as np
from scipy.io.matlab import loadmat
import sktensor, random
import pandas as pd
from scipy.sparse import lil_matrix
from sktensor.rescal import als as rescal_als
from numpy import zeros, dot
from numpy.linalg import norm
from sklearn.metrics import ... | d3m-model-search-master | test_data/test_cases_only/59_umls/59_umls_solution/src/pipeline.py |
from unittest import TestCase
from base import AbstractFeatureSelector
import numpy as np
from scipy import stats
from scipy.sparse import issparse
from sklearn.feature_selection import f_classif, SelectFromModel, SelectPercentile
from sklearn.linear_model import Lasso
from sklearn.svm import LinearSVC
from sklearn.... | d3m-model-search-master | test_data/test_cases_only/534_cps_85_wages/534_cps_85_wages_solution/modules/feature_selection.py |
from base import AbstractEstimator
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.kernel_approximation import RBFSampler
from sklearn.linear_model import SGDClassifier, SGDRegressor
class SGDClassifierEstimator(AbstractEstimator):
param_distributions = {
'loss'... | d3m-model-search-master | test_data/test_cases_only/534_cps_85_wages/534_cps_85_wages_solution/modules/estimation.py |
d3m-model-search-master | test_data/test_cases_only/534_cps_85_wages/534_cps_85_wages_solution/modules/__init__.py | |
from collections import defaultdict, OrderedDict
import numpy as np
from scipy import signal
from scipy.sparse import csr_matrix, hstack
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.cluster import MiniBatchKMeans
from sklearn.feature_extraction.text import TfidfVectorizer
fr... | d3m-model-search-master | test_data/test_cases_only/534_cps_85_wages/534_cps_85_wages_solution/modules/feature_extraction.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.