Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TP-Clustering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IA et Machine Learning
TP-Clustering
Commits
2ae48d82
Commit
2ae48d82
authored
1 year ago
by
thibault.capt
Browse files
Options
Downloads
Patches
Plain Diff
update wrong dimensions
parent
7b43ffed
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.idea/misc.xml
+1
-1
1 addition, 1 deletion
.idea/misc.xml
perceptron-tp3.py
+4
-3
4 additions, 3 deletions
perceptron-tp3.py
with
5 additions
and
4 deletions
.idea/misc.xml
+
1
−
1
View file @
2ae48d82
...
@@ -6,5 +6,5 @@
...
@@ -6,5 +6,5 @@
<component
name=
"MarkdownSettingsMigration"
>
<component
name=
"MarkdownSettingsMigration"
>
<option
name=
"stateVersion"
value=
"1"
/>
<option
name=
"stateVersion"
value=
"1"
/>
</component>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.9"
project-jdk-type=
"Python SDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.9
(tp-clustering)
"
project-jdk-type=
"Python SDK"
/>
</project>
</project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
perceptron-tp3.py
+
4
−
3
View file @
2ae48d82
...
@@ -35,7 +35,7 @@ if __name__ == '__main__':
...
@@ -35,7 +35,7 @@ if __name__ == '__main__':
y
=
dataset
.
iloc
[:,
0
].
values
y
=
dataset
.
iloc
[:,
0
].
values
num_features
=
X
.
shape
[
1
]
num_features
=
X
.
shape
[
1
]
learning_rate
=
1e-
2
learning_rate
=
1e-
3
max_iterations
=
2000
max_iterations
=
2000
num_hidden
=
10
num_hidden
=
10
...
@@ -82,12 +82,12 @@ if __name__ == '__main__':
...
@@ -82,12 +82,12 @@ if __name__ == '__main__':
print
(
f
"
Taux de classifications correctes:
{
accuracy
*
100
}
%
"
)
print
(
f
"
Taux de classifications correctes:
{
accuracy
*
100
}
%
"
)
# Affichage de la droite de séparation des classes
# Affichage de la droite de séparation des classes
w1
,
w2
,
b
=
weights_
hidden_output
[
1
],
weights_hidden_output
[
2
],
weights_hidden_output
[
0
]
w1
,
w2
,
b
=
weights_
input_hidden
[
1
,
1
],
weights_input_hidden
[
2
,
1
],
weights_input_hidden
[
0
,
1
]
pente
=
-
w1
/
w2
pente
=
-
w1
/
w2
intercept
=
-
b
/
w2
intercept
=
-
b
/
w2
print
(
f
"
Droite de séparation: y =
{
pente
}
x +
{
intercept
}
"
)
print
(
f
"
Droite de séparation: y =
{
pente
}
x +
{
intercept
}
"
)
# Tracer la droite de séparation
(diagonale)
# Tracer la droite de séparation
plt
.
figure
()
plt
.
figure
()
plt
.
scatter
(
X
[
y
==
0
][:,
0
],
X
[
y
==
0
][:,
1
],
color
=
'
red
'
,
label
=
'
Classe 0
'
)
plt
.
scatter
(
X
[
y
==
0
][:,
0
],
X
[
y
==
0
][:,
1
],
color
=
'
red
'
,
label
=
'
Classe 0
'
)
plt
.
scatter
(
X
[
y
==
1
][:,
0
],
X
[
y
==
1
][:,
1
],
color
=
'
blue
'
,
label
=
'
Classe 1
'
)
plt
.
scatter
(
X
[
y
==
1
][:,
0
],
X
[
y
==
1
][:,
1
],
color
=
'
blue
'
,
label
=
'
Classe 1
'
)
...
@@ -97,3 +97,4 @@ if __name__ == '__main__':
...
@@ -97,3 +97,4 @@ if __name__ == '__main__':
plt
.
ylabel
(
'
Norm_Grade_2
'
)
plt
.
ylabel
(
'
Norm_Grade_2
'
)
plt
.
legend
()
plt
.
legend
()
plt
.
show
()
plt
.
show
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment