Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
82fcfa0e
Commit
82fcfa0e
authored
Jan 17, 2017
by
wxchan
Committed by
Guolin Ke
Jan 17, 2017
Browse files
fix warning; fix doc bug (#232)
parent
a2ae8384
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
.github/ISSUE_TEMPLATE.md
.github/ISSUE_TEMPLATE.md
+4
-2
docs/Python-intro.md
docs/Python-intro.md
+2
-2
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+2
-2
No files found.
.github/ISSUE_TEMPLATE.md
View file @
82fcfa0e
[](
For
bugs and unexpected issues, please provide the following information, so that we could reproduce in our system)
Please search your question on previous issues, stackoverflow or other search engines before you open a new one.
For bugs and unexpected issues, please provide following information, so that we could reproduce on our system.
## Environment info
Operating System:
CPU:
C++/Python/R version:
## Error Message:
## Reproducible examples
## Steps to reproduce
...
...
docs/Python-intro.md
View file @
82fcfa0e
...
...
@@ -78,13 +78,13 @@ LightGBM can use categorical features as input directly. It doesn't need to cove
#### Weights can be set when needed:
```
python
w
=
np
.
random
.
rand
(
500
,
1
)
w
=
np
.
random
.
rand
(
500
,
)
train_data
=
lgb
.
Dataset
(
data
,
label
=
label
,
weight
=
w
)
```
or
```
python
train_data
=
lgb
.
Dataset
(
data
,
label
=
label
)
w
=
np
.
random
.
rand
(
500
,
1
)
w
=
np
.
random
.
rand
(
500
,
)
train_data
.
set_weight
(
w
)
```
...
...
python-package/lightgbm/basic.py
View file @
82fcfa0e
...
...
@@ -222,7 +222,7 @@ PANDAS_DTYPE_MAPPER = {'int8': 'int', 'int16': 'int', 'int32': 'int',
def
_data_from_pandas
(
data
,
feature_name
,
categorical_feature
,
pandas_categorical
):
if
isinstance
(
data
,
DataFrame
):
if
feature_name
==
'auto'
or
feature_name
is
None
:
data
.
rename
(
columns
=
str
,
inplace
=
True
)
data
=
data
.
rename
(
columns
=
str
)
cat_cols
=
data
.
select_dtypes
(
include
=
[
'category'
]).
columns
if
pandas_categorical
is
None
:
# train dataset
pandas_categorical
=
[
list
(
data
[
col
].
cat
.
categories
)
for
col
in
cat_cols
]
...
...
@@ -241,7 +241,7 @@ def _data_from_pandas(data, feature_name, categorical_feature, pandas_categorica
if
categorical_feature
==
'auto'
:
categorical_feature
=
list
(
cat_cols
)
else
:
categorical_feature
+
=
list
(
cat_cols
)
categorical_feature
=
list
(
categorical_feature
)
+
list
(
cat_cols
)
if
feature_name
==
'auto'
:
feature_name
=
list
(
data
.
columns
)
data_dtypes
=
data
.
dtypes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment