Skip to content

Commit

Permalink
Merge pull request #433 from HyunjunA/infvisfrontendmlbackend
Browse files Browse the repository at this point in the history
test learning curve
  • Loading branch information
HyunjunA authored Dec 5, 2022
2 parents a4e6949 + 7cb5587 commit 8400128
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions machine/learn/skl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
from sklearn.preprocessing import OneHotEncoder, OrdinalEncoder, LabelEncoder
from sklearn.model_selection import GridSearchCV, cross_validate, StratifiedKFold, KFold
from sklearn.metrics import SCORERS, roc_curve, auc, make_scorer, confusion_matrix

from sklearn.manifold import TSNE
from sklearn.model_selection import learning_curve
from sklearn import decomposition

import itertools
import json
import os
Expand All @@ -46,10 +51,12 @@
import numpy as np
import pandas as pd
import matplotlib as mpl
from sklearn import decomposition

import matplotlib.colors as mcolors
from matplotlib.patches import Patch
from sklearn.manifold import TSNE




mpl.use('Agg')

Expand Down Expand Up @@ -370,7 +377,7 @@ def generate_results(model, input_data,
model = clf.best_estimator_
else:
print("param_grid else")
# plot_learning_curve(tmpdir,_id, model,features,target,cv,return_times=True)
plot_learning_curve(tmpdir,_id, model,features,target,cv,return_times=True)
model.fit(features, target)


Expand Down Expand Up @@ -1087,9 +1094,7 @@ def plot_imp_score(tmpdir, _id, coefs, feature_names, imp_score_type):

def plot_learning_curve(tmpdir,_id,model,features,target,cv,return_times=True):

from sklearn.model_selection import learning_curve
from matplotlib import pyplot as plt
import numpy as np



features = np.array(features)
Expand Down

0 comments on commit 8400128

Please sign in to comment.