This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # we assume the set of rules is a Python list; | |
| # native Python set-type isn't suitable to store the rules | |
| rules = [rule1, rule2, rule3] | |
| def score(rule, *args, **kwargs): | |
| # args, kwargs -- some additional parameters, if needed.. | |
| pass | |
| # Implement score function for an individual rule here... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # It is highly recommended to use Pandas for such data processing problems | |
| import pandas as pd | |
| import numpy as np | |
| dataset = {'feature1': np.random.rand(5000), | |
| 'feature2': np.random.rand(5000), | |
| 'feature3': np.random.rand(5000) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Hi, Nadeem! | |
| Let's dive in deep how the most of clustering algorithms work. This allows us | |
| to find what kind of encoding should be used to handle such categorical data. | |
| If we consider hierarchical clustering algorithms, they use distances between | |
| objects/items to be clustered and form groups according some linkage rules. | |
| So, distances between objects are very important when do clustering. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| lat_min = 45.0 | |
| lat_max = 60.0 | |
| lon_min = 85.0 | |
| lon_max = 100.0 | |
| density = 3 # three points per `squared` degree | |
| import numpy as np | |
| np.random.seed(30) # for reproducibility, this line could be deleted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": 6, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "import pandas as pd\n", | |
| "data = pd.read_clipboard(header=None)" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # occurrence table plot -- species (load it from csv) | |
| table1 <- read.table("table1.csv", sep=";") | |
| table2 <- read.table("table2.csv", sep=";") | |
| # talble of features sp -- feature (load data from csv) | |
| # table2 <- cbind(c(1,1,0),c(0,0,1), c(0,1,0)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Based on: https://www.kaggle.com/dingdiego/u-net-batchnorm-augmentation-stratification | |
| U-Net: Convolutional Networks for Biomedical Image Segmentation | |
| (https://arxiv.org/abs/1505.04597) | |
| --- | |
| img_shape: (height, width, channels) | |
| out_ch: number of output channels | |
| start_ch: number of channels of the first conv | |
| depth: zero indexed depth of the U-structure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Node: | |
| def __init__(self, value, type): | |
| self.value = value | |
| self.type = type | |
| intervals = [[2, 10], [3, 7], [4, 7], [6, 8], [8, 9]] | |
| nodes = list() | |
| for interval in intervals: | |
| nodes.append(Node(interval[0],'l')) | |
| nodes.append(Node(interval[1],'r')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd /code | |
| COM_PATH=/mnt/c/odm | |
| for prjname in ussurisky; | |
| do | |
| cd /code | |
| ./run.sh --project-path $COM_PATH $prjname --max-concurrency 3 --dtm --dsm --use-exif --verbose | |
| tar -C $COM_PATH --exclude=$prjname/images --exclude=$prjname/opensfm -zcvf $COM_PATH/$prjname.tar.gz $prjname |
OlderNewer