This file contains 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
def __one_level(graph, status, weight_key, resolution, randomize,mu = 0.3): | |
"""Compute one level of communities | |
""" | |
modified = True | |
nb_pass_done = 0 | |
cur_mod = __modularity_lft(status,mu) | |
new_mod = cur_mod | |
while modified and nb_pass_done != __PASS_MAX: |
This file contains 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
2941561;368675;16.377;48.211;1293042855 | |
3882724;173269;34.556715;64.94765;1241538032 | |
3775999;359701;33.993401;44.403049;1311428721 | |
2607668;218800;20.147056;54.943008;1243931341 | |
4905424;82440;30.398488;60.03975;1247841069 | |
355950;181701;24.425058;48.251538;1247108309 | |
4526238;340438;29.595168;60.199008;1268849274 | |
2806911;257379;37.898466;55.757825;1265365984 | |
2566479;243252;37.682061;55.615429;1284296417 | |
66427;214366;34.594239;29.138155;1262598588 |
This file contains 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
id | line_name | station_name | station_type | delay_morning | delay_rush | delay_night | lat | lon | |
---|---|---|---|---|---|---|---|---|---|
0 | Сокольническая | Бульвар Рокоссовского | deadend | 120 | 90 | 360 | 55.81426884 | 37.73511681 | |
1 | Сокольническая | Черкизовская | pass | 120 | 90 | 360 | 55.80299055 | 37.74482527 | |
2 | Сокольническая | Преображенская площадь | pass | 120 | 90 | 360 | 55.79617167 | 37.71502233 | |
3 | Сокольническая | Сокольники | pass | 120 | 90 | 360 | 55.78920017 | 37.67970569 | |
4 | Сокольническая | Красносельская | pass | 120 | 90 | 360 | 55.7798531 | 37.66607717 | |
5 | Сокольническая | Комсомольская | cross | 120 | 90 | 360 | 55.77461681 | 37.65606048 | |
6 | Сокольническая | Красные ворота | pass | 120 | 90 | 360 | 55.76879536 | 37.64889473 | |
7 | Сокольническая | Чистые пруды | cross | 120 | 90 | 360 | 55.76479568 | 37.63869126 | |
8 | Сокольническая | Лубянка | cross | 120 | 90 | 360 | 55.75916377 | 37.62734802 |
This file contains 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
id_from | id_to | line_from | station_from | line_to | station_to | route_type | delay | |
---|---|---|---|---|---|---|---|---|
0 | 1 | Сокольническая | Бульвар Рокоссовского | Сокольническая | Черкизовская | drive | 120 | |
1 | 0 | Сокольническая | Черкизовская | Сокольническая | Бульвар Рокоссовского | drive | 120 | |
1 | 2 | Сокольническая | Черкизовская | Сокольническая | Преображенская площадь | drive | 240 | |
2 | 1 | Сокольническая | Преображенская площадь | Сокольническая | Черкизовская | drive | 240 | |
2 | 3 | Сокольническая | Преображенская площадь | Сокольническая | Сокольники | drive | 180 | |
3 | 2 | Сокольническая | Сокольники | Сокольническая | Преображенская площадь | drive | 180 | |
3 | 4 | Сокольническая | Сокольники | Сокольническая | Красносельская | drive | 120 | |
4 | 3 | Сокольническая | Красносельская | Сокольническая | Сокольники | drive | 120 | |
4 | 5 | Сокольническая | Красносельская | Сокольническая | Комсомольская | drive | 120 |
This file contains 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 os | |
import io | |
import time | |
import random | |
from io import StringIO | |
from collections import defaultdict | |
import numpy as np | |
import urllib.request | |
import six.moves.urllib as urllib |
This file contains 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
@w=split' ',do{open$h,'<a.txt';<$h>;};push@w,@w[0..2];@r=@w[0..2];sub z{$_[rand@_]}%d=do{for$i(0..$#w-3){@p=@w[$i..$i+2];push@{$s{join' ',@p}},$w[$i+3];}%s};for(1..200){$e=z(@{$d{join' ',@r}});shift@r;push@r,$e;print$e." ";} |
This file contains 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
perl -0pe's/(\r*\n)+/ /g;' nano.txt|perl -040e'@w=<>;@r=@w[0..2];push@{$s{"@w[$_..$_+2]"}},$w[$_+3]for(0..@w-3);for(@w){push@r,$s{"@r"}[rand@{$s{"@r"}}];print shift@r}' |
This file contains 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
en | |
nltk | |
http://snowball.tartarus.org/algorithms/porter/stemmer.html | |
http://snowball.tartarus.org/algorithms/english/stemmer.html | |
http://proiot.ru/jssnowball/ (online), source https://github.com/mazko/jssnowball | |
porter stemmer (много на гитхабе) | |
ru | |
nltk | |
http://snowball.tartarus.org/algorithms/russian/stemmer.html |
This file contains 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
cluster | item | |
---|---|---|
cluster0 | 1_card_nav | |
cluster0 | 1_card_sel | |
cluster0 | 1_ord_ady | |
cluster0 | 10_card_sel | |
cluster0 | 100_ord_sel | |
cluster0 | 100_ord_yrk | |
cluster0 | 11_card_nav | |
cluster0 | 11_card_yrk | |
cluster0 | 11_coll_nld |
This file contains 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
cluster | item | |
---|---|---|
cluster0 | 1_fracden_bul | |
cluster0 | 1_fracden_nld | |
cluster0 | 1_fracnum_nld | |
cluster0 | 10_approx_bul | |
cluster0 | 10_fracden_bul | |
cluster0 | 10_fracden_heb | |
cluster0 | 10_fracden_nld | |
cluster0 | 10_fracnum_nld | |
cluster0 | 100_approx_bul |
OlderNewer