Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Devops for v3.0.1#252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
minjk-bl merged 7 commits intovisualpython:devopsfromminjk-bl:devops
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionvisualpython/html/m_ml/evaluation.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,7 +38,7 @@
<label><input type="checkbox" id="accuracy" class="vp-state"><span>Accuracy</span></label>
<label><input type="checkbox" id="precision" class="vp-state"><span>Precision</span></label>
<label><input type="checkbox" id="recall" class="vp-state"><span>Recall</span></label>
<label><input type="checkbox" id="f1_score" class="vp-state"><span>F1-scorev</label>
<label><input type="checkbox" id="f1_score" class="vp-state"><span>F1-score</label>
<!-- <hr style="margin: 5px;"/> -->
<!-- <label><input type="checkbox" id="roc_curve" class="vp-eval-check vp-state" data-type="roc-auc"><span>ROC Curve</span></label>
<label><input type="checkbox" id="auc" class="vp-eval-check vp-state" data-type="roc-auc"><span>AUC</span></label> -->
Expand Down
29 changes: 17 additions & 12 deletionsvisualpython/js/m_apps/Frame.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -115,10 +115,10 @@ define([
id: 'encoding',
label: 'Encoding',
axis: FRAME_AXIS.COLUMN,
selection: FRAME_SELECT_TYPE.SINGLE,
selection: FRAME_SELECT_TYPE.MULTI,
child: [
{ id: 'label_encoding', label: 'Label encoding', axis: FRAME_AXIS.COLUMN, selection: FRAME_SELECT_TYPE.SINGLE, menuType: FRAME_EDIT_TYPE.LABEL_ENCODING },
{ id: 'one_hot_encoding', label: 'Onehot encoding', axis: FRAME_AXIS.COLUMN, selection: FRAME_SELECT_TYPE.SINGLE, menuType: FRAME_EDIT_TYPE.ONE_HOT_ENCODING },
{ id: 'label_encoding', label: 'Label encoding', axis: FRAME_AXIS.COLUMN, selection: FRAME_SELECT_TYPE.MULTI, menuType: FRAME_EDIT_TYPE.LABEL_ENCODING },
{ id: 'one_hot_encoding', label: 'Onehot encoding', axis: FRAME_AXIS.COLUMN, selection: FRAME_SELECT_TYPE.MULTI, menuType: FRAME_EDIT_TYPE.ONE_HOT_ENCODING },
]
},
{
Expand DownExpand Up@@ -2767,7 +2767,7 @@ define([
var condText = $(condTextTag[i]).prop('checked');
var operConn = $(operConnTag[i]).val();
var condObj = {};
if (col !== '' && oper !== '' && cond !== '') {
if (col !== '' && oper !== '' &&(oper == 'isnull()' || oper === 'notnull()' ||cond !== '')) {
condObj = {
oper: oper,
cond: com_util.convertToStr(cond, condText)
Expand DownExpand Up@@ -2808,7 +2808,7 @@ define([
var condText = $(condTextTag[i]).prop('checked');
var operConn = $(operConnTag[i]).val();
var condObj = {};
if (col !== '' && oper !== '' && cond !== '') {
if (col !== '' && oper !== '' &&(oper == 'isnull()' || oper === 'notnull()' ||cond !== '')) {
condObj = {
colName: col,
oper: oper,
Expand DownExpand Up@@ -2861,7 +2861,7 @@ define([
var condText = $(condTextTag[i]).prop('checked');
var operConn = $(operConnTag[i]).val();
var condObj = {};
if (col !== '' && oper !== '' && cond !== '') {
if (col !== '' && oper !== '' &&(oper == 'isnull()' || oper === 'notnull()' ||cond !== '')) {
condObj = {
colName: col,
oper: oper,
Expand DownExpand Up@@ -2894,7 +2894,7 @@ define([
var condText = $(condTextTag[i]).prop('checked');
var operConn = $(operConnTag[i]).val();
var condObj = {};
if (col !== '' && oper !== '' && cond !== '') {
if (col !== '' && oper !== '' &&(oper == 'isnull()' || oper === 'notnull()' ||cond !== '')) {
condObj = {
oper: oper,
cond: com_util.convertToStr(cond, condText)
Expand DownExpand Up@@ -3237,13 +3237,18 @@ define([
break;
case FRAME_EDIT_TYPE.LABEL_ENCODING:
if (axis == FRAME_AXIS.COLUMN) {
letencodedColName = this.state.selected.map(col=> {
letencodedColNameList = this.state.selected.map(col=> {
if (col.code !== col.label) {
return com_util.formatString("'{0}'", col.label+ '_label');
return{ 'origin':com_util.formatString("'{0}'", col.label), 'encoded': com_util.formatString("'{0}'", col.label+ '_label') };
}
return col.label + '_label'
}).join(',');
code.appendFormat("{0}[{1}] = pd.Categorical({2}[{3}]).codes", tempObj, encodedColName, tempObj, selectedName);
return { 'origin': col.label, 'encoded': col.label + '_label' };
});
encodedColNameList.forEach((encodedColObj, idx) => {
if (idx > 0) {
code.appendLine();
}
code.appendFormat("{0}[{1}] = pd.Categorical({2}[{3}]).codes", tempObj, encodedColObj['encoded'], tempObj, encodedColObj['origin']);
});
}
break;
case FRAME_EDIT_TYPE.ONE_HOT_ENCODING:
Expand Down
14 changes: 12 additions & 2 deletionsvisualpython/js/m_apps/Groupby.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -177,7 +177,7 @@ define([
var colList = event.dataList;
that.state.display = colList;

if (colList && colList.length == 1) {
if ((colList && colList.length == 1) || that.state.method === 'size') {
$(that.wrapSelector('#vp_gbToFrame')).parent().show();
} else {
$(that.wrapSelector('#vp_gbToFrame')).parent().hide();
Expand All@@ -196,6 +196,12 @@ define([
var method = $(this).val();
that.state.method = method;
$(that.wrapSelector('#vp_gbMethod')).val(method);

if (method === 'size' || (that.state.display && that.state.display.length == 1)) {
$(that.wrapSelector('#vp_gbToFrame')).parent().show();
} else {
$(that.wrapSelector('#vp_gbToFrame')).parent().hide();
}
});

// advanced checkbox event
Expand DownExpand Up@@ -744,7 +750,7 @@ define([
// Display columns
//====================================================================
var colStr = '';
if (display) {
if (display && display.length > 0) {
if (toFrame || display.length > 1) {
// over 2 columns
colStr = '[[' + display.join(',') + ']]';
Expand DownExpand Up@@ -891,6 +897,10 @@ define([
methodStr.appendFormat('{0}(numeric_only=True)', method);
} else {
methodStr.appendFormat('{0}()', method);
if (method === 'size' && toFrame === true) {
// if to_Frame on size() method
methodStr.append(".to_frame(name='size')");
}
}
}
}
Expand Down
8 changes: 6 additions & 2 deletionsvisualpython/js/m_apps/Subset.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1810,6 +1810,10 @@ define([
rowSelection.append(')');
} else {
rowSelection.appendFormat('({0}', varName);
if (colName == '.index') {
// index
rowSelection.append('.index');
}
oper && rowSelection.appendFormat(' {0}', oper);
if (cond) {
// condition value as text
Expand DownExpand Up@@ -1863,7 +1867,7 @@ define([
var colList = [];
for (var i = 0; i < colTags.length; i++) {
var colValue = $(colTags[i]).data('code');
if (colValue) {
if (colValue !== undefined) {
colList.push(colValue);
}
}
Expand All@@ -1873,7 +1877,7 @@ define([
$(this.wrapSelector('.' + VP_DS_TO_FRAME)).parent().show();

// to frame
if (this.state.toFrame) {
if (this.state.toFrame === true) {
colSelection.appendFormat('[{0}]', colList.toString());
this.state.returnType = 'DataFrame';
} else {
Expand Down
4 changes: 2 additions & 2 deletionsvisualpython/js/m_ml/evaluation.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -276,8 +276,8 @@ define([
// }
if (r_squared) {
code = new com_String();
code.appendLine("# Rsquare");
code.appendFormat("print('Rsquare: {}'.format(metrics.r2_score({0}, {1})))", targetData, predictData);
code.appendLine("# Rsquared");
code.appendFormat("print('Rsquared: {}'.format(metrics.r2_score({0}, {1})))", targetData, predictData);
codeCells.push(code.toString());
}
if (mae) {
Expand Down
2 changes: 1 addition & 1 deletionvisualpython/python/userCommand.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -130,7 +130,7 @@ def vp_create_permutation_importances(model, X_train, y_train, scoring=None, sor
if isinstance(X_train, _vp_pd.core.frame.DataFrame):
feature_names = X_train.columns
else:
feature_names = [ 'X{}'.format(i) for i in range(len(model.feature_importances_)) ]
feature_names = [ 'X{}'.format(i) for i in range(X_train.shape[1]) ]

imp = permutation_importance(model, X_train, y_train, scoring=scoring)

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp