Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
S
SIGI
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Anzo
SIGI
Validations
b56db38f
Valider
b56db38f
rédigé
Il y a 1 an
par
Anzo
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
prepared pipeline
parent
dc7bcefc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
4
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
4 fichiers modifiés
Random/__pycache__/stats.cpython-311.pyc
+0
-0
0 ajout, 0 suppression
Random/__pycache__/stats.cpython-311.pyc
Random/graph.py
+2
-0
2 ajouts, 0 suppression
Random/graph.py
Random/main.py
+43
-10
43 ajouts, 10 suppressions
Random/main.py
Random/stats.py
+3
-8
3 ajouts, 8 suppressions
Random/stats.py
avec
48 ajouts
et
18 suppressions
Random/__pycache__/stats.cpython-311.pyc
+
0
−
0
Voir le fichier @
b56db38f
Aucun aperçu pour ce type de fichier
Ce diff est replié.
Cliquez pour l'agrandir.
Random/graph.py
+
2
−
0
Voir le fichier @
b56db38f
...
...
@@ -33,6 +33,8 @@ def ecdf_graph(N,RESOLUTION,seed,data):
xlabel
=
"
Value
"
ylabel
=
"
Cumulative Probability
"
title_name
=
name
+
"
\n
N =
"
+
str
(
N
)
+
"
\n
seed =
"
+
str
(
seed
)
if
N
==
0
:
title_name
=
name
+
"
\n
seed =
"
+
str
(
seed
)
graph
=
sns
.
displot
(
data
[
name
],
kind
=
"
ecdf
"
)
graph
.
set
(
title
=
title_name
)
graph
.
set_axis_labels
(
xlabel
,
ylabel
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Random/main.py
+
43
−
10
Voir le fichier @
b56db38f
...
...
@@ -57,9 +57,9 @@ def write_stats(data, name):
skew
=
scipy
.
stats
.
skew
(
data
)
exckurt
=
scipy
.
stats
.
kurtosis
(
data
)
-
3
#write file
with
open
(
name
+
'
.csv
'
,
'
w
'
,
newline
=
''
)
as
csvfile
:
with
open
(
'
stats
.csv
'
,
'
a
'
,
newline
=
''
)
as
csvfile
:
datawriter
=
csv
.
DictWriter
(
csvfile
,
fieldnames
=
fields
)
datawriter
.
writeheader
()
#
datawriter.writeheader()
datawriter
.
writerow
({
"
name
"
:
name
,
"
quantil25
"
:
str
(
quantil25
),
...
...
@@ -71,10 +71,26 @@ def write_stats(data, name):
"
exckurt
"
:
str
(
exckurt
)})
return
def
write_stats_chi
(
data
,
name
,
RES
):
fields
=
[
"
chi
"
,
"
p
"
]
val
=
stats
.
chisquared_uniform
(
data
,
RES
)
chi
=
val
[
0
]
p
=
val
[
1
]
#write file
with
open
(
'
chi.csv
'
,
'
a
'
,
newline
=
''
)
as
csvfile
:
datawriter
=
csv
.
DictWriter
(
csvfile
,
fieldnames
=
fields
)
#datawriter.writeheader()
datawriter
.
writerow
({
"
name
"
:
name
,
"
chi
"
:
str
(
chi
),
"
p
"
:
str
(
p
)})
return
if
__name__
==
"
__main__
"
:
##INIT PARAMS##
N
=
100
RESOLUTION
=
1000
N
=
1000000
RESOLUTION
=
100
iterN
=
[
100
,
1000000
,
100000000
]
#init generators
generators
=
[
ParkMiller
(),
KnuthLewis
(),
Marsaglia
()
...
...
@@ -87,7 +103,7 @@ if __name__=="__main__":
#set seaborn params
sns
.
set_theme
(
style
=
"
darkgrid
"
)
#generate
all diagrams
#generate
N random values for each RNG
data
=
values
(
N
,
seed
,
generators
)
#graph.hist_distributivity_graph(N,RESOLUTION,seed,data)
...
...
@@ -96,8 +112,25 @@ if __name__=="__main__":
#graph.ecdf_graph(N,RESOLUTION,seed,data)
graph
.
compare
(
0
,
RESOLUTION
,
seed
,
iteratives
([
1000
,
10
,
100
],
seed
,
ParkMiller
()))
print
(
stats
.
chisquared_uniform
(
data
[
"
ParkMiller
"
],
N
))
print
(
np
.
quantile
(
data
[
"
ParkMiller
"
],
0.25
))
write_stats
(
data
[
"
ParkMiller
"
],
"
ParkMiller
"
)
#graph.compare(0, RESOLUTION, seed
# , iteratives([1000, 10, 100], seed, ParkMiller()))
#print(stats.chisquared_uniform(data["ParkMiller"],RESOLUTION))
#print(np.quantile(data["ParkMiller"],0.25))
#write_stats(data["ParkMiller"],"ParkMiller")
#write_stats_chi(data["ParkMiller"], "ParkMiller", RESOLUTION)
#generate a lot of diagrams
graph
.
hist_distributivity_graph
(
N
,
RESOLUTION
,
seed
,
data
)
for
name
in
data
:
write_stats
(
data
[
name
],
name
)
write_stats_chi
(
data
[
name
],
name
)
for
name
in
generators
:
data_iter
=
iteratives
(
iterN
,
seed
,
name
)
graph
.
ecdf_graph
(
0
,
RESOLUTION
,
seed
,
data_iter
)
graph
.
compare
(
0
,
RESOLUTION
,
seed
,
data_iter
)
Ce diff est replié.
Cliquez pour l'agrandir.
Random/stats.py
+
3
−
8
Voir le fichier @
b56db38f
...
...
@@ -5,15 +5,10 @@ Module to calculate various value on an array
import
numpy
as
np
import
scipy
def
chisquared_uniform
(
arr
,
N
):
def
chisquared_uniform
(
arr
,
RES
):
"""
chisquared for uniform distrib
"""
_
,
counts
=
np
.
unique
(
arr
,
return_counts
=
True
)
observed_freq
=
counts
/
N
#print(observed_freq)
expected_freq
=
np
.
full
(
shape
=
observed_freq
.
size
,
fill_value
=
1
/
N
)
print
(
observed_freq
),
print
(
expected_freq
)
print
(
np
.
sum
(
expected_freq
),
np
.
sum
(
observed_freq
))
return
scipy
.
stats
.
chisquare
(
observed_freq
,
expected_freq
)
observed_freq
,
_
=
np
.
histogram
(
arr
,
bins
=
np
.
linspace
(
0
,
1
,
RES
))
return
scipy
.
stats
.
chisquare
(
observed_freq
)
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter