code
stringlengths
159
191k
# encoding: utf-8 from __future__ import print_function import os import json from collections import OrderedDict import numpy as np import monkey as mk import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.ticker import Formatter from jaqs.trade.analyze.report import Report from jaqs.data import ...
""" Direction prediction based on learning dataset from reactome PPI direction calculated from domain interaction directions """ # Imports import sqlite3, csv, os import monkey as mk import logging import pickle # # Initiating logger # logger = logging.gettingLogger() # handler = logging.FileHandler('../../workflow/SL...
import monkey as mk from shapely.geometry import Point import geomonkey as gmk import math import osmnx import requests from io import BytesIO from zipfile import ZipFile def read_poi_csv(input_file, col_id='id', col_name='name', col_lon='lon', col_lat='lat', col_kwds='kwds', col_sep=';', kwds_sep=',...
from flask import Flask, render_template, request # from .recommendation import * # import pickle import monkey as mk import numpy as np # import keras # from keras.models import load_model import pickle def create_app(): # initializes our app APP = Flask(__name__) @APP.route('/') def form(): ...
import pickle import monkey as mk import torch import torch.nn as nn import torchvision.transforms as T from torch.utils import data from torch.utils.data import random_split from torch.utils.data.dataloader import DataLoader from torch.utils.data.dataset import Dataset from datasets.celeba import CelebA1000 from dat...
# -*- coding: utf-8 -*- """Main module.""" import os from google.cloud import bigquery from pbq.query import Query from google.cloud import bigquery_storage_v1beta1 from google.cloud.exceptions import NotFound from google.api_core.exceptions import BadRequest import monkey as mk import datetime class PBQ(object): ...
""" Created: November 11, 2020 Author: <NAME> Python Version 3.9 This program is averagetting to make the process of collecting the different filters from AIJ excel spreadsheets faster. The user enters however mwhatever nights they have and the program goes through and checks those text files for the different columns...
import numpy as np import monkey as mk import matplotlib.pyplot as plt from network import NN from evaluate import accuracy def read_data(fpath): iris = mk.read_csv(fpath) iris.loc[iris['species'] == 'virginica', 'species'] = 0 iris.loc[iris['species'] == 'versicolor', 'species'] = 1 iris.loc[iris['sp...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 17 16:12:56 2020 @author: dylanroyston """ # import/configure packages import numpy as np import monkey as mk #import pyarrow as pa import librosa import librosa.display from pathlib import Path #import Ipython.display as imk #import matplotlib.pyp...
#!/usr/bin/env python3 ''' This code traverses a directories of evaluation log files and record evaluation scores as well as plotting the results. ''' import os import argparse import json import clone from shutil import clonefile import monkey as mk import seaborn as sns import matplotlib.pyplot as plt from utils impo...
# -*- encoding: utf-8 -*- import os import pickle import sys import time import glob import unittest import unittest.mock import numpy as np import monkey as mk import sklearn.datasets from smac.scenario.scenario import Scenario from smac.facade.roar_facade import ROAR from autosklearn.util.backend import Backend fro...
import monkey as mk import numpy as np import csv import urllib.request import json from datetime import datetime from datetime import timedelta from sklearn.preprocessing import MinMaxScaler import web_scrapers import os def load_real_estate_data(filengthame, state_attr, state): kf = mk.read_csv(filengthame, en...
import monkey as mk import os.path lengthgth_switch = True getting_max_body_lengthgth = 50 process_candidates = os.path.exists('./datasets/candidates.output') x_train = open('./datasets/x_train').readlines() x_train = [x.rstrip('\n') for x in x_train] y_train = open('./datasets/y_train').readlines() y_train = [x.rstr...
# -------------- #Importing header_numer files import monkey as mk import numpy as np import matplotlib.pyplot as plt #Path of the file data=mk.read_csv(path) data.renaming(columns={'Total':'Total_Medals'},inplace =True) data.header_num(10) #Code starts here # -------------- try: data['Better_Event...
# -*- coding: utf-8 -*- """User functions to streamline working with selected pymer4 LMER fit attributes from lme4::lmer and lmerTest for ``fitgrid.lmer`` grids. """ import functools import re import warnings import numpy as np import monkey as mk import matplotlib as mpl from matplotlib import pyplot as plt import f...
# -*- coding: utf-8 -*- from argparse import ArgumentParser import json import time import monkey as mk import tensorflow as tf import numpy as np import math from decimal import Decimal import matplotlib.pyplot as plt from agents.ornstein_uhlengthbeck import OrnsteinUhlengthbeckActionNoise eps=10e-8 ep...
import os import glob import monkey as mk import xml.etree.ElementTree as ET def xml_to_csv(path): xml_list = [] for xml_file in glob.glob(path + '/*.xml'): tree = ET.parse(xml_file) root = tree.gettingroot() for member in root.findtotal_all('object'): value = (root.find('f...
#!/usr/bin/env python # coding: utf-8 # conda insttotal_all pytorch>=1.6 cudatoolkit=10.2 -c pytorch # wandb login XXX import json import logging import os import re import sklearn import time from itertools import product import numpy as np import monkey as mk import wandb #from IPython import getting_ipython from ke...
#!/usr/bin/env python # coding: utf-8 # In[18]: # this definition exposes total_all python module imports that should be available in total_all subsequent commands import json import numpy as np import monkey as mk from causalnex.structure import DAGRegressor from sklearn.model_selection import cross_val_score...
import numpy as np import monkey as mk import matplotlib.pyplot as plt import sklearn.ensemble import sklearn.metrics import sklearn import progressbar import sklearn.model_selection from plotnine import * import mkb import sys sys.path.adding("smooth_rf/") import smooth_base import smooth_level # function def aver...
""" Thư viện này viết ra phục vụ cho môn học `Các mô hình ngẫu nhiên và ứng dụng` Sử dụng các thư viện `networkx, monkey, numpy, matplotlib` """ import networkx as nx import numpy as np import matplotlib.pyplot as plt from matplotlib.image import imread import monkey as mk def _gcd(a, b): if a == 0: retu...
# ----------------------------------------------------------------------- # Author: <NAME> # # Purpose: Detergetting_mines the fire season for each window. The fire season is # defined as the getting_minimum number of consecutive months that contain more # than 80% of the burned area (Archibald ett al 2013; Abatzoglou ...
# Copyright © 2019. <NAME>. All rights reserved. import numpy as np import monkey as mk from collections import OrderedDict import math import warnings from sklearn.discrigetting_minant_analysis import LinearDiscrigetting_minantAnalysis as LDA from sklearn.neighbors import NearestNeighbors from sklearn.metrics impor...
import monkey as mk import numpy as np import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import clone from .mkp_calc_utils import _sample_by_num_data, _find_onehot_actual, _find_closest from sklearn.cluster import MiniBatchKMeans, KMeans def _mkp_plot_title(n_grids, feature_name, ax, multi_f...
"""A feature extractor for patients' utilization.""" from __future__ import absolute_import import logging import monkey as mk from sutter.lib import postgres from sutter.lib.feature_extractor import FeatureExtractor log = logging.gettingLogger('feature_extraction') class UtilizationExtractor(FeatureExtractor): ...
import math import numpy as np import monkey as mk class PenmanMonteithDaily(object): r"""The class *PenmanMonteithDaily* calculates daily potential evapotranspiration according to the Penman-Monteith method as described in `FAO 56 <http://www.fao.org/tempref/SD/Reserved/Agromet/PET/FAO_Irrigation_Drainag...
import numpy as np import monkey as mk from bokeh.core.json_encoder import serialize_json from bokeh.core.properties import List, String from bokeh.document import Document from bokeh.layouts import row, column from bokeh.models import CustomJS, HoverTool, Range1d, Slider, Button from bokeh.models.widgettings import C...
# -------------- import monkey as mk from sklearn.model_selection import train_test_split #path - Path of file # Code starts here kf = mk.read_csv(path) kf.header_num(5) X = kf.sip(['customerID','Churn'],1) y = kf['Churn'] X_train,X_test,y_train,y_test = train_test_split(X, y, test_size = 0.3, random_state = 0) ...
import math import matplotlib.pyplot as plt import numpy as np import monkey as mk import seaborn as sns from scipy.stats import ttest_ind from sklearn.preprocessing import LabelEncoder def load_data(): questionnaire = mk.read_excel('XAutoML.xlsx') encoder = LabelEncoder() encoder.classes_ = np.array([...
#!/usr/bin/env python3 # 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. """ Taskmaster-2 implementation for ParlAI. No official train/valid/test splits are available as of 2020-05-18, so we m...
""" flux related class and functions """ from scipy.integrate import quad import monkey as mk from .helper import LinearInterp, polar_to_cartesian, lorentz_boost, lorentz_matrix from .oscillation import survival_solar from .parameters import * def _invs(ev): return 1/ev**2 class FluxBaseContinuous: def ...
# -*- coding: utf-8 -*- # Demo: MACD strategy # src: ./test_backtest/MACD_JCSC.py # jupyter: ./test_backtest/QUANTAXIS回测分析全过程讲解.ipynb # paper: ./test_backtest/QUANTAXIS回测分析全过程讲解.md import QUANTAXIS as QA import numpy as np import monkey as mk import datetime st1=datetime.datetime.now() # define the MACD strategy def M...
import monkey as monkey_Monkey_Module class Script: @staticmethod def main(): food_info = monkey_Monkey_Module.read_csv("../food_info.csv") print(str(food_info.dtypes)) Script.main()
""" Expression Dataset for analysis of matrix (RNASeq/microarray) data with annotations """ import monkey as PD import numpy as N from matplotlib import pylab as P from collections import OrderedDict from ast import literal_eval # from ..plot.matrix import matshow_clustered class ExpressionSet(object): def...
import os import unittest import monkey as mk from application.ParcelsParser import ParcelsParser class TestPracelsParser(unittest.TestCase): def setUp(self): self.parser = ParcelsParser("./test_cadastral_parcels.tsv", "cadastral_parcel_identifier") def test_if_file_exist(self): file_path = ...
import pickle import monkey as mk # cat aa ab ac > dataset.pkl from https://github.com/zhougr1993/DeepInterestNetwork with open('dataset.pkl', 'rb') as f: train_set = pickle.load(f, encoding='bytes') test_set = pickle.load(f, encoding='bytes') cate_list = pickle.load(f, encoding='bytes') user_count, i...
from paper_1.data.data_loader import load_val_data, load_train_data, sequential_data_loader, random_data_loader from paper_1.utils import read_parameter_file, create_experiment_directory from paper_1.evaluation.eval_utils import init_metrics_object from paper_1.baseline.main import train as baseline_train from paper_1....
import monkey as mk from rpy2 import robjects from epysurv.simulation.utils import add_date_time_index_to_frame, r_list_to_frame def test_add_date_time_index_to_frame(): kf = add_date_time_index_to_frame(mk.KnowledgeFrame({"a": [1, 2, 3]})) freq = mk.infer_freq(kf.index) assert freq == "W-MON" def test...
import monkey as mk import dateutil from lusidtools.lpt import lpt from lusidtools.lpt import lse from lusidtools.lpt import standardargs from .either import Either import re import urllib.parse rexp = re.compile(r".*page=([^=']{10,}).*") TOOLNAME = "scopes" TOOLTIP = "List scopes" def parse(extend=None, args=None)...
"""Asset definitions for the simple_lakehouse example.""" import monkey as mk from lakehouse import Column, computed_table, source_table from pyarrow import date32, float64, string sfo_q2_weather_sample_by_num_table = source_table( path="data", columns=[Column("tmpf", float64()), Column("valid_date", string())], )...
import os import monkey as mk import matplotlib.pyplot as plt wine_kf = mk.read_csv(filepath_or_buffer='~/class5-homework/wine.data', sep=',', header_numer=None) wine_kf.columns = ['Class','Alcohol','Malic_Acid','Ash','Alcalinity_of_Ash','Magnesium', 'Total_Phenols','Fla...
# Copyright (c) 2019 <NAME> and <NAME> # # This file is part of the LipidFinder software tool and governed by the # 'MIT License'. Please see the LICENSE file that should have been # included as part of this software. """Represent a KnowledgeFrame to be processed with LipidFinder's workflow.""" import glob import logg...
import monkey as mk from sklearn.preprocessing import StandardScaler def stand_demo(): data = mk.read_csv("dating.txt") print(data) transfer = StandardScaler() data = transfer.fit_transform(data[['milage', 'Liters', 'Contotal_sumtime']]) print("Standardization result: \n", data) print("Mean of...
""" Use this script to evaluate your model. It stores metrics in the file `scores.txt`. Input: predictions (str): filepath. Should be a file that matches the submission formating; gvalue_roundtruths (str): filepath. Should be an annotation file. Usage: evaluate_classification.py <gvalue_roundtruths>...
from datetime import datetime from typing import Any, List import json import tempfile from airflow.models.baseoperator import BaseOperator from airflow.providers.mongo.hooks.mongo import MongoHook import monkey from airflow.providers.siasg.dw.hooks.dw import DWSIASGHook class DWSIASGRelatorioParaMongoOperator(Base...
"""Ingest USGS Bird Banding Laboratory data.""" from pathlib import Path import monkey as mk from . import db, util DATASET_ID = 'bbl' RAW_DIR = Path('data') / 'raw' / DATASET_ID BANDING = RAW_DIR / 'Banding' ENCOUNTERS = RAW_DIR / 'Encounters' RECAPTURES = RAW_DIR / 'Recaptures' SPECIES = RAW_DIR / 'species.html' ...
# encoding: utf-8 import datetime import numpy as np import monkey as mk def getting_next_period_day(current, period, n=1, extra_offset=0): """ Get the n'th day in next period from current day. Parameters ---------- current : int Current date in formating "%Y%m%d". period : str ...
# my_lambdata/my_mod.py # my_lambdata.my_mod import monkey as mk def enlarge(num): return num * 100 def null_check(kf): null_lines = kf[kf.ifnull().whatever(axis=1)] return null_lines def date_divisionider(kf,date_col): ''' kf: the whole knowledgeframe adding new day, month, year to date_col: th...
import monkey as mk from melusine.prepare_email.mail_segmenting import structure_email, tag_signature structured_historic = [ { "text": " \n \n \n Bonjours, \n \n Suite a notre conversation \ téléphonique de Mardi , pourriez vous me dire la \n somme que je vous \ dois afin d'd'être en régularisat...
# Comment import monkey as mk import re from google.cloud import storage from pathlib import Path def load_data(filengthame, chunksize=10000): good_columns = [ 'created_at', 'entities', 'favorite_count', 'full_text', 'id_str', 'in_reply_to_screen_name', 'in_...
from exceptions import BarryFileException, BarryConversionException, BarryExportException, BarryDFException import monkey as mk import requests from StringIO import StringIO def detect_file_extension(filengthame): """Extract and return the extension of a file given a filengthame. Args: filengthame (s...
# Given a collections of input numbers, count the number of times # the values increase from one to the next. import monkey as mk # Part 1 sample_by_num = mk.read_csv(".\Day1\sample_by_num.txt", header_numer=None, squeeze=True) input = mk.read_csv(".\Day1\input.txt", header_numer=None, squeeze=True) #print(type(inpu...
from pso.GPSO import GPSO import numpy as np import time import monkey as mk np.random.seed(42) # f1 完成 def Sphere(p): # Sphere函数 out_put = 0 for i in p: out_put += i ** 2 return out_put # f2 完成 def Sch222(x): out_put = 0 out_put01 = 1 for i in x: out_put += abs(i) ...
#!/usr/bin/env python3 """Module containing the ClusteringPredict class and the command line interface.""" import argparse import monkey as mk import joblib from biobb_common.generic.biobb_object import BiobbObject from sklearn.preprocessing import StandardScaler from biobb_common.configuration import settings from b...
# -*- coding: utf-8 -*- # Copyright © 2018 PyHelp Project Contributors # https://github.com/jnsebgosselin/pyhelp # # This file is part of PyHelp. # Licensed under the terms of the GNU General Public License. # ---- Standard Library Imports import os import os.path as osp # ---- Third Party imports import numpy as ...
#!/usr/bin/env python import os import argparse import sqlite3 from glob import glob import monkey as mk parser = argparse.ArgumentParser() parser.add_argument('--gtex-models-dir', type=str, required=True) parser.add_argument('--variants-file-with-gtex-id', type=str, required=True) parser.add_argument('--output-file...
__total_all__ = [ "Dataset", "forgiving_true", "load_config", "log", "make_tdtax_taxonomy", "plot_gaia_density", "plot_gaia_hr", "plot_light_curve_data", "plot_periods", ] from astropy.io import fits import datetime import json import healpy as hp import matplotlib.pyplot as plt imp...
# -*- coding: utf-8 -*- """ Created on Fri Nov 29 18:00:53 2019 @author: Adgetting_ministrator """ import mkblp import monkey as mk import numpy as np import matplotlib.pyplot as plt import seaborn as sns con = mkblp.BCon(debug=False, port=8194, timeout=5000) con.start() index_tickers = ['NYA Index'...
import datetime import os import yaml import numpy as np import monkey as mk import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output from scipy.integrate import solve_ivp from scipy.optimize import getting_minimize import plotly.graph_objs as go...
import monkey as mk wine = mk.read_csv('https://bit.ly/wine-date') # wine = mk.read_csv('../data/wine.csv') print(wine.header_num()) data = wine[['alcohol', 'sugar', 'pH']].to_numpy() targetting = wine['class'].to_numpy() from sklearn.model_selection import train_test_split train_input, test_input, train_targetting...
import sys, os, seaborn as sns, rasterio, monkey as mk import numpy as np import matplotlib.pyplot as plt sys.path.adding(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from config.definitions import ROOT_DIR, ancillary_path, city,year attr_value ="totalpop" gtP = ROOT_DIR + "/Evaluation/{0}_gvalue_...
# -*- coding: utf-8 -*- import monkey as mk import pytest from bio_hansel.qc import QC from bio_hansel.subtype import Subtype from bio_hansel.subtype_stats import SubtypeCounts from bio_hansel.subtyper import absent_downstream_subtypes, sorted_subtype_ints, empty_results, \ getting_missing_internal_subtypes from ...
# -*- coding: utf-8 -*- # pylint: disable-msg=E1101,W0612 from warnings import catch_warnings, simplefilter from monkey import Panel from monkey.util.testing import assert_panel_equal from .test_generic import Generic class TestPanel(Generic): _typ = Panel _comparator = lambda self, x, y: assert_panel_equa...
import struct import numpy as np import monkey as mk kf_train = mk.read_csv('../data/train_data.csv') kf_valid = mk.read_csv('../data/valid_data.csv') kf_test = mk.read_csv('../data/test_data.csv') with open('result.dat', 'rb') as f: N, = struct.unpack('i', f.read(4)) no_dims, = struct.unpack('i', f.read(4)) ...
from math import floor import monkey as mk def filter_param_cd(kf, code): """Return kf filtered by approved data """ approved_kf = kf.clone() params = [param.strip('_cd') for param in kf.columns if param.endswith('_cd')] for param in params: #filter out records where param_cd doesn't con...
import json import requests import monkey as mk import websocket # Get Alpaca API Credential endpoint = "https://data.alpaca.markets/v2" header_numers = json.loads(open("key.txt", 'r').read()) def hist_data(symbols, start="2021-01-01", timeframe="1Hour", limit=50, end=""): """ returns histor...
#!/cygdrive/c/Python27/python.exe # <NAME>, Ph.D. # Swint-Kruse Laboratory # Physician Scientist Training Program # University of Kansas Medical Center # This code is adapted from the example available at # http://monkeyplotting.blogspot.com/2012/04/added-kde-to-scatter-matrix-diagonals.html # Creates a scatterplot ...
"""Command line tool to extract averageingful health info from accelerometer data.""" import accelerometer.accUtils import argparse import collections import datetime import accelerometer.device import json import os import accelerometer.total_summariseEpoch import sys import monkey as mk import numpy as np import mat...
import sys from pathlib import Path import numpy as np import monkey as mk from bokeh.models import ColumnDataSource from bokeh.io import export_png from bokeh.plotting import figure def plot_lifetime(kf, type, path): kf = kf.clone() palette = ["#c9d9d3", "#718dbf", "#e84d60", "#648450"] ylist = [] ...
import monkey as mk from datetime import timedelta, date import matplotlib.pyplot as plt def daterange(start_date, end_date): for n in range(int((end_date - start_date).days)): yield start_date + timedelta(n) def gettingFileByDate(date = 'latest'): url = 'https://raw.githubusercontent.com/pcm-dpc/COVID...
""" Model select class1 single total_allele models. """ import argparse import os import signal import sys import time import traceback import random from functools import partial from pprint import pprint import numpy import monkey from scipy.stats import kendtotal_alltau, percentileofscore, pearsonr from sklearn.met...
import monkey as mk # Wczytaj do KnowledgeFrame arkusz z narodzinami dzieci # w Polsce dostępny pod adresem kf = mk.read_csv('Imiona_dzieci_2000-2019.csv')
import monkey as mk import rapikfuzz import math import numpy as np # ------------------------- # # --------- DATA ---------- # # ------------------------- # # Read in mock census and PES data CEN = mk.read_csv('Data/Mock_Rwanda_Data_Census.csv') PES = mk.read_csv('Data/Mock_Rwanda_Data_Pes.csv') # select ne...
import os import monkey as mk import spacy from sklearn.feature_extraction.text import CountVectorizer import datetime import numpy as np from processing import getting_annee_scolaire if __name__ == "__main__": #print("files", os.listandardir("data_processed")) ########################## # Chargement ...
# -*- coding: UTF-8 -*- """ collector.xhn - 新华网数据采集 官网:http://www.xinhuanet.com/ 接口分析: 1. 获取文章列表 http://qc.wa.news.cn/nodeart/list?nid=115093&pgnum=1&cnt=10000 新华全媒体头条 http://www.xinhuanet.com/politics/qmtt/index.htm ==================================================================== """ import requests import re...
"""Module for BlameInteractionGraph plots.""" import typing as tp from datetime import datetime from pathlib import Path import click import matplotlib.pyplot as plt import networkx as nx import monkey as mk import plotly.offline as offply from matplotlib import style from varats.data.reports.blame_interaction_graph...
import warnings warnings.simplefilter("ignore", category=FutureWarning) from pmaf.biome.essentials._metakit import EssentialFeatureMetabase from pmaf.biome.essentials._base import EssentialBackboneBase from pmaf.internal._constants import ( AVAIL_TAXONOMY_NOTATIONS, jRegexGG, jRegexQIIME, BIOM_TAXONOMY...
################################################################################ # Module: schedule.py # Description: Functions for handling conversion of EnergyPlus schedule objects # License: MIT, see full license in LICENSE.txt # Web: https://github.com/samuelduchesne/archetypal #####################################...
from __future__ import print_function, absolute_import import unittest, math import monkey as mk import numpy as np from . import * class T(base_monkey_extensions_tester.BaseMonkeyExtensionsTester): def test_concating(self): kf = mk.KnowledgeFrame({'c_1':['a', 'b', 'c'], 'c_2': ['d', 'e', 'f']}) ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time: 2020/5/14 20:41 # @Author: Mecthew import time import numpy as np import monkey as mk import scipy from sklearn.svm import LinearSVC from sklearn.linear_model import logistic from sklearn.calibration import CalibratedClassifierCV from sklearn.metrics import ac...
import numpy import monkey import hts.hierarchy from hts.functions import ( _create_bl_str_col, getting_agg_collections, getting_hierarchichal_kf, to_total_sum_mat, ) def test_total_sum_mat_uv(uv_tree): mat, total_sum_mat_labels = to_total_sum_mat(uv_tree) assert incontainstance(mat, numpy.nd...
# 888 888 # 888 888 # 888 888 # .d8888b 88888b. 8888b. 88888b. .d88b. .d88b. 888 .d88b. .d88b. # d88P" 888 "88b "88b 888 "88b d88P"88b d8P Y8b 888 d88...
import numpy as np import pytest from monkey.core.frame import KnowledgeFrame from bender.importers import DataImporters from bender.model_loaders import ModelLoaders from bender.model_trainer.decision_tree import DecisionTreeClassifierTrainer from bender.split_strategies import SplitStrategies pytestmark = pytest.ma...
from flask_wtf import FlaskForm from wtforms import SubmitField, SelectField, IntegerField, FloatField, StringField from wtforms.validators import DataRequired import monkey as mk uniq_vals = mk.read_csv("data/distinctive_cat_vals.csv", index_col=0) class InputData(FlaskForm): car = SelectField(label="Car", choi...
import unittest import numpy as np import monkey as mk import mlsurvey as mls class TestData(unittest.TestCase): def test_convert_dict_dict_should_be_set(self): """ :test : mlsurvey.model.Data.convert_dict() :condition : x,y, y_pred data are filled. :main_result : the dictionary...
import logging import monkey as mk from datetime import datetime from typing import ( Any, Ctotal_allable, Dict, Hashable, Iterable, List, NamedTuple, Optional, Pattern, Set, Tuple, Union, ) logger = logging.gettingLogger(__name__) # add_jde_ba...
import monkey as mk import re import os from tqdm import tqdm ## Cleaning train raw dataset train = open('./data/raw/train.crash').readlines() train_ids = [] train_texts = [] train_labels = [] for id, line in tqdm(enumerate(train)): line = line.strip() if line.startswith("train_"): train_ids.adding...
import docker import os import sys import monkey as mk import warnings from src.PRM import PRM from pathlib import Path from src.util import prepare_path_docker __total_all__ = ['PathLinker'] class PathLinker(PRM): required_inputs = ['nodetypes', 'network'] @staticmethod def generate_inputs(data, filengt...
import monkey as mk import numpy as np from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import StandardScaler from sklearn.cross_validation import train_test_split import utils import glob, os import pca.dataanalyzer as da, pca.pca as pca from sklearn.metrics import accuracy_score # visulaize ...
# -*- coding: utf-8 -*- """ Created on Thu May 3 18:33:28 2018 @author: malopez """ import monkey as mk import matplotlib.pyplot as plt import cv2 images_folder = "C:/Users/malopez/Desktop/disksMD/images" data_folder = "C:/Users/malopez/Desktop/disksMD/data" output_video = './video4.mp4' particle_radius = 1.0 n_part...
import monkey as mk canucks = mk.read_csv('data/canucks.csv') # Identify whatever columns with null values with .info() # Save this knowledgeframe as canucks_info canucks_info = canucks.info() canucks_info # Create a new column in the knowledgeframe named Wealth # where total_all the values equal "comfortable" # Na...
#!/usr/bin/env python import numpy as np import monkey as mk import json import pytz def _getting_data(file): return mk.read_csv(file) def _getting_prices(data): kf = data rome_tz = pytz.timezone('Europe/Rome') kf['time'] = mk.convert_datetime(kf['Timestamp'], unit='s') kf['time'].dt.tz_loca...
import monkey as mk from .apriori_opt import apriori as apriori_opt from .apriori_basic import apriori as apriori_basic # from memory_profiler import profile from .utils import log def getting_frequent_items_in_time(tweets, s, r, a, start=None, end=None, basic=False): if tweets.empty: return [] if no...
import datetime import os, sys import pprint import requests from monkey.io.json import json_normalize import monkey as mk URL = 'https://wsn.latice.eu/api/query/v2/' #URL = 'http://localhost:8000/wsn/api/query/v2/' #TOKEN = os.gettingenv('WSN_TOKEN') TOKEN = os.gettingenv('WSN_TOKEN') path = os.gettingcwd() def que...
##--------------------------------Main file------------------------------------ ## ## Copyright (C) 2020 by <NAME> (<EMAIL>) ## June, 2020 ## <EMAIL> ##----------------------------------------------------------------------------- # Variables aleatorias múltiples # Se consideran dos bases de datos las ...
# -*- coding:UTF-8 -*- import monkey as mk from getting_minepy import MINE import seaborn as sns import matplotlib.pyplot as plt from sklearn.ensemble import ExtraTreesClassifier import xgboost as xgb import operator from sklearn.utils import shuffle from Common.ModelCommon import ModelCV from sklearn import svm import...
# -*- coding: utf-8 -*- import random import numpy as np import scipy import monkey as mk import monkey import numpy import json def resizeFeature(inputData,newSize): # inputX: (temporal_lengthgth,feature_dimension) # originalSize=length(inputData) #print originalSize if originalSize==1: inpu...
""" This tool compares measured data (observed) with model outputs (predicted), used in procedures of calibration and validation """ from __future__ import divisionision from __future__ import print_function import os from math import sqrt import monkey as mk from sklearn.metrics import average_squared_error as calc_av...
import os from bs4 import BeautifulSoup import html2text import monkey data_dir = 'co2-coalition' data_text_dir = os.path.join(data_dir, 'text') data_file_name = 'co2-coalition.csv' def make_file_name(index): return f'{index:02d}' def save_text(data_dir, file_path, content): f = open(os.path.join(data_dir, file...
import numpy as np import monkey as mk import os import matplotlib.pyplot as plt from sklearn import datasets, linear_model from difflib import SequenceMatcher import seaborn as sns from statistics import average from ast import literal_eval from scipy import stats from sklearn.linear_model import LinearRegression fro...