Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
iamap
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
Container 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
AMAP
iamap
Commits
bd0f7824
Commit
bd0f7824
authored
5 months ago
by
paul.tresson_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
check if model does regression or classification
parent
2abd27e2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ml.py
+9
-2
9 additions, 2 deletions
ml.py
with
9 additions
and
2 deletions
ml.py
+
9
−
2
View file @
bd0f7824
...
@@ -38,7 +38,7 @@ from sklearn.preprocessing import LabelEncoder
...
@@ -38,7 +38,7 @@ from sklearn.preprocessing import LabelEncoder
from
sklearn.model_selection
import
train_test_split
from
sklearn.model_selection
import
train_test_split
from
.utils.misc
import
get_unique_filename
from
.utils.misc
import
get_unique_filename
from
.utils.geo
import
get_random_samples_in_gdf
from
.utils.geo
import
get_random_samples_in_gdf
,
get_unique_col_name
from
.utils.algo
import
(
from
.utils.algo
import
(
SHPAlgorithm
,
SHPAlgorithm
,
get_sklearn_algorithms_with_methods
,
get_sklearn_algorithms_with_methods
,
...
@@ -48,7 +48,14 @@ from .utils.algo import (
...
@@ -48,7 +48,14 @@ from .utils.algo import (
import
sklearn.ensemble
as
ensemble
import
sklearn.ensemble
as
ensemble
import
sklearn.neighbors
as
neighbors
import
sklearn.neighbors
as
neighbors
from
sklearn.base
import
ClassifierMixin
,
RegressorMixin
def
check_model_type
(
model
):
if
isinstance
(
model
,
ClassifierMixin
):
return
"
classification
"
elif
isinstance
(
model
,
RegressorMixin
):
return
"
regression
"
else
:
return
"
unknown
"
class
MLAlgorithm
(
SHPAlgorithm
):
class
MLAlgorithm
(
SHPAlgorithm
):
...
...
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